CWS-TOOLING: integrate CWS mtaccfixes

This commit is contained in:
Vladimir Glazunov
2010-03-24 14:12:03 +01:00
9 changed files with 32 additions and 41 deletions

View File

@@ -53,13 +53,12 @@ class VCLXAccessibleEdit : public VCLXAccessibleTextComponent,
friend class VCLXAccessibleBox;
private:
sal_Int32 m_nSelectionStart;
sal_Int32 m_nCaretPosition;
protected:
virtual ~VCLXAccessibleEdit();
void UpdateCaretPosition();
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );

View File

@@ -395,7 +395,7 @@ inline bool hasFloatingChild(Window *pWindow)
else
xContext = new FloatingWindowAccessible( _pXWindow );
}
else if ( nType == WINDOW_HELPTEXTWINDOW )
else if ( ( nType == WINDOW_HELPTEXTWINDOW ) || ( nType == WINDOW_FIXEDLINE ) )
{
xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleFixedText( _pXWindow );
}

View File

@@ -67,6 +67,7 @@ using namespace ::comphelper;
VCLXAccessibleEdit::VCLXAccessibleEdit( VCLXWindow* pVCLWindow )
:VCLXAccessibleTextComponent( pVCLWindow )
{
m_nSelectionStart = getSelectionStart();
m_nCaretPosition = getCaretPosition();
}
@@ -78,22 +79,6 @@ VCLXAccessibleEdit::~VCLXAccessibleEdit()
// -----------------------------------------------------------------------------
void VCLXAccessibleEdit::UpdateCaretPosition()
{
sal_Int32 nCaretPosition = getCaretPosition();
if ( m_nCaretPosition != nCaretPosition )
{
Any aOldValue, aNewValue;
aOldValue <<= (sal_Int32) m_nCaretPosition;
aNewValue <<= (sal_Int32) nCaretPosition;
m_nCaretPosition = nCaretPosition;
NotifyAccessibleEvent( AccessibleEventId::CARET_CHANGED, aOldValue, aNewValue );
}
}
// -----------------------------------------------------------------------------
void VCLXAccessibleEdit::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
switch ( rVclWindowEvent.GetId() )
@@ -105,11 +90,31 @@ void VCLXAccessibleEdit::ProcessWindowEvent( const VclWindowEvent& rVclWindowEve
break;
case VCLEVENT_EDIT_SELECTIONCHANGED:
{
sal_Int32 nOldCaretPosition = m_nCaretPosition;
sal_Int32 nOldSelectionStart = m_nSelectionStart;
m_nCaretPosition = getCaretPosition();
m_nSelectionStart = getSelectionStart();
Window* pWindow = GetWindow();
if ( pWindow && pWindow->HasChildPathFocus() )
{
NotifyAccessibleEvent( AccessibleEventId::TEXT_SELECTION_CHANGED, Any(), Any() );
UpdateCaretPosition();
if ( m_nCaretPosition != nOldCaretPosition )
{
Any aOldValue, aNewValue;
aOldValue <<= (sal_Int32) nOldCaretPosition;
aNewValue <<= (sal_Int32) m_nCaretPosition;
NotifyAccessibleEvent( AccessibleEventId::CARET_CHANGED, aOldValue, aNewValue );
}
// #i104470# VCL only has SELECTION_CHANGED, but UAA distinguishes between SELECTION_CHANGED and CARET_CHANGED
sal_Bool bHasSelection = ( m_nSelectionStart != m_nCaretPosition );
sal_Bool bHadSelection = ( nOldSelectionStart != nOldCaretPosition );
if ( ( bHasSelection != bHadSelection ) || ( bHasSelection && ( ( m_nCaretPosition != nOldCaretPosition ) || ( m_nSelectionStart != nOldSelectionStart ) ) ) )
{
NotifyAccessibleEvent( AccessibleEventId::TEXT_SELECTION_CHANGED, Any(), Any() );
}
}
}
break;
@@ -305,22 +310,13 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleEdit::getAccessibleActionKeyBin
sal_Int32 VCLXAccessibleEdit::getCaretPosition( ) throw (RuntimeException)
{
OExternalLockGuard aGuard( this );
awt::Selection aSelection;
VCLXEdit* pVCLXEdit = static_cast< VCLXEdit* >( GetVCLXWindow() );
if ( pVCLXEdit )
aSelection = pVCLXEdit->getSelection();
return aSelection.Max;
return getSelectionEnd();
}
// -----------------------------------------------------------------------------
sal_Bool VCLXAccessibleEdit::setCaretPosition( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
{
OExternalLockGuard aGuard( this );
return setSelection( nIndex, nIndex );
}

View File

@@ -67,6 +67,7 @@ class SvxGeneralTabPage : public SfxTabPage
{
using TabPage::DeactivatePage;
private:
FixedLine aAddrFrm;
FixedText aCompanyLbl;
SvxUserEdit aCompanyEdit;
FixedText aNameLbl;
@@ -97,12 +98,10 @@ private:
FixedText aFaxMailLbl;
SvxUserEdit aFaxEdit;
SvxUserEdit aEmailEdit;
FixedLine aAddrFrm;
CheckBox aUseDataCB;
GeneralTabPage_Impl* pImpl;
#ifdef _SVX_OPTGENRL_CXX
DECL_LINK( ModifyHdl_Impl, Edit * );

View File

@@ -51,13 +51,13 @@ namespace svx
class DbRegistrationOptionsPage : public SfxTabPage
{
private:
FixedLine aStdBox;
FixedText aTypeText;
FixedText aPathText;
SvxControlFocusHelper aPathCtrl;
PushButton m_aNew;
PushButton m_aEdit;
PushButton m_aDelete;
FixedLine aStdBox;
HeaderBar* pHeaderBar;
::svx::OptHeaderTabListBox* pPathBox;
@@ -65,7 +65,6 @@ namespace svx
ULONG m_nOldCount;
BOOL m_bModified;
#ifdef SVX_DBREGISTER_HXX
DECL_LINK( NewHdl, void * );
DECL_LINK( EditHdl, void * );

View File

@@ -68,12 +68,12 @@ class SvxPathTabPage;
class SvxPathTabPage : public SfxTabPage
{
private:
FixedLine aStdBox;
FixedText aTypeText;
FixedText aPathText;
SvxControlFocusHelper aPathCtrl;
PushButton aStandardBtn;
PushButton aPathBtn;
FixedLine aStdBox;
HeaderBar* pHeaderBar;
::svx::OptHeaderTabListBox* pPathBox;

View File

@@ -118,13 +118,13 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
SfxTabPage( pParent, CUI_RES( RID_SFXPAGE_DBREGISTER), rSet ),
aStdBox ( this, CUI_RES( GB_STD ) ),
aTypeText ( this, CUI_RES( FT_TYPE ) ),
aPathText ( this, CUI_RES( FT_PATH ) ),
aPathCtrl ( this, CUI_RES( LB_PATH ) ),
m_aNew ( this, CUI_RES( BTN_NEW ) ),
m_aEdit ( this, CUI_RES( BTN_EDIT ) ),
m_aDelete ( this, CUI_RES( BTN_DELETE ) ),
aStdBox ( this, CUI_RES( GB_STD ) ),
pHeaderBar ( NULL ),
pPathBox ( NULL ),
m_pCurEntry ( NULL ),

View File

@@ -94,6 +94,7 @@ SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSe
SfxTabPage( pParent, CUI_RES(RID_SFXPAGE_GENERAL), rCoreSet ),
aAddrFrm ( this, CUI_RES( GB_ADDRESS ) ),
aCompanyLbl ( this, CUI_RES( FT_COMPANY ), true ),
aCompanyEdit ( this, CUI_RES( ED_COMPANY ), INDEX_NOTSET, &aCompanyLbl ),
aNameLbl ( this, CUI_RES( FT_NAME ), true ),
@@ -124,9 +125,7 @@ SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSe
aFaxMailLbl ( this, CUI_RES( FT_FAXMAIL ), true ),
aFaxEdit ( this, CUI_RES( ED_FAX ), 0, &aFaxMailLbl ),
aEmailEdit ( this, CUI_RES( ED_EMAIL ), 1, &aFaxMailLbl ),
aAddrFrm ( this, CUI_RES( GB_ADDRESS ) ),
aUseDataCB ( this, CUI_RES( CB_USEDATA ) ),
pImpl ( new GeneralTabPage_Impl )
{

View File

@@ -217,13 +217,12 @@ SvxPathTabPage::SvxPathTabPage( Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage( pParent, CUI_RES( RID_SFXPAGE_PATH ), rSet ),
aStdBox ( this, CUI_RES( GB_STD ) ),
aTypeText ( this, CUI_RES( FT_TYPE ) ),
aPathText ( this, CUI_RES( FT_PATH ) ),
aPathCtrl ( this, CUI_RES( LB_PATH ) ),
aStandardBtn ( this, CUI_RES( BTN_STANDARD ) ),
aPathBtn ( this, CUI_RES( BTN_PATH ) ),
aStdBox ( this, CUI_RES( GB_STD ) ),
pHeaderBar ( NULL ),
pPathBox ( NULL ),
pImpl ( new OptPath_Impl( CUI_RES(IMG_LOCK), CUI_RES(IMG_LOCK_HC) ) ),