diff options
author | Steve Yin <steve_y@apache.org> | 2013-11-26 10:51:41 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-26 10:59:08 +0000 |
commit | 968a76817340cafaeb239b71164974e3c0c43f04 (patch) | |
tree | 00d596f9ab6dd023648bcdbd1897150d3da5ee37 /toolkit/source/awt/vclxaccessiblecomponent.cxx | |
parent | 22029c7e17b4cb48acb058d47ec9c3b6b8b6b294 (diff) |
Integrate branch of IAccessible2
Change-Id: I95b681a7aa171c321a876e6a38392e30583d7a5b
Diffstat (limited to 'toolkit/source/awt/vclxaccessiblecomponent.cxx')
-rw-r--r-- | toolkit/source/awt/vclxaccessiblecomponent.cxx | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index e1be4c15f190..c087b14455be 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -31,6 +31,7 @@ #include <vcl/dialog.hxx> #include <vcl/vclevent.hxx> #include <vcl/window.hxx> +#include <vcl/edit.hxx> #include <tools/debug.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> @@ -436,13 +437,46 @@ void VCLXAccessibleComponent::FillAccessibleStateSet( utl::AccessibleStateSetHel if ( pWindow->GetStyle() & WB_SIZEABLE ) rStateSet.AddState( accessibility::AccessibleStateType::RESIZABLE ); - + // 6. frame doesn't have MOVABLE state + // 10. for password text, where is the sensitive state? + if( ( getAccessibleRole() == accessibility::AccessibleRole::FRAME ||getAccessibleRole() == accessibility::AccessibleRole::DIALOG )&& pWindow->GetStyle() & WB_MOVEABLE ) + rStateSet.AddState( accessibility::AccessibleStateType::MOVEABLE ); if( pWindow->IsDialog() ) { Dialog *pDlg = static_cast< Dialog* >( pWindow ); if( pDlg->IsInExecute() ) rStateSet.AddState( accessibility::AccessibleStateType::MODAL ); } + //If a combobox or list's edit child isn't read-only,EDITABLE state + //should be set. + if( pWindow && pWindow->GetType() == WINDOW_COMBOBOX ) + { + if( !( pWindow->GetStyle() & WB_READONLY) || + !((Edit*)pWindow)->IsReadOnly() ) + rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE ); + } + + Window* pChild = pWindow->GetWindow( WINDOW_FIRSTCHILD ); + + while( pWindow && pChild ) + { + Window* pWinTemp = pChild->GetWindow( WINDOW_FIRSTCHILD ); + if( pWinTemp && pWinTemp->GetType() == WINDOW_EDIT ) + { + if( !( pWinTemp->GetStyle() & WB_READONLY) || + !((Edit*)pWinTemp)->IsReadOnly() ) + rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE ); + break; + } + if( pChild->GetType() == WINDOW_EDIT ) + { + if( !( pChild->GetStyle() & WB_READONLY) || + !((Edit*)pChild)->IsReadOnly()) + rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE ); + break; + } + pChild = pChild->GetWindow( WINDOW_NEXT ); + } } else { @@ -767,6 +801,9 @@ sal_Int32 SAL_CALL VCLXAccessibleComponent::getForeground( ) throw (uno::Runtim else aFont = pWindow->GetFont(); nColor = aFont.GetColor().GetColor(); + // COL_AUTO is not very meaningful for AT + if ( nColor == (sal_Int32)COL_AUTO) + nColor = pWindow->GetTextColor().GetColor(); } } |