diff options
author | Andre Fischer <af@openoffice.org> | 2002-11-25 11:49:49 +0000 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2002-11-25 11:49:49 +0000 |
commit | 03ab1a4b2fcda72ec5709a6caf3899b77dffd8e9 (patch) | |
tree | 196589a5d7f98da490190874eb4bc2aa1293d03e /svtools | |
parent | ad118e2b99ef28e480ddfd5f4311a60ba8decd7f (diff) |
#104955# Added the 'no fill' button as accessible child.
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/valueacc.cxx | 22 | ||||
-rw-r--r-- | svtools/source/control/valueset.cxx | 25 |
2 files changed, 32 insertions, 15 deletions
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 8adaed17c0d5..978dca6e00ea 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: valueacc.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: af $ $Date: 2002-11-20 16:35:31 $ + * last change: $Author: af $ $Date: 2002-11-25 12:49:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -213,7 +213,11 @@ sal_Int32 SAL_CALL ValueSetAcc::getAccessibleChildCount() throw (uno::RuntimeException) { const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - return( mpParent->ImplGetVisibleItemCount() ); + sal_Int32 nCount = 0; + if ((mpParent->GetStyle() & ~WB_NONEFIELD) != 0) + nCount += 1; + nCount += mpParent->ImplGetVisibleItemCount(); + return nCount; } // ----------------------------------------------------------------------------- @@ -223,7 +227,17 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible { const vos::OGuard aSolarGuard( Application::GetSolarMutex() ); uno::Reference< accessibility::XAccessible > xRet; - ValueSetItem* pItem = mpParent->ImplGetVisibleItem( static_cast< USHORT >( i ) ); + ValueSetItem* pItem = NULL; + + if ((mpParent->GetStyle() & ~WB_NONEFIELD) != 0) + if (i == 0) + // When present the first item is the then allways visible none field. + pItem = mpParent->ImplGetItem (VALUESET_ITEM_NONEITEM); + else + // Shift down the index to compensate for the none field. + i -= 1; + if (pItem == NULL) + pItem = mpParent->ImplGetVisibleItem( static_cast< USHORT >( i ) ); if( pItem ) xRet = pItem->GetAccessible(); diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 296452bd8853..de6e33c00582 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -2,9 +2,9 @@ * * $RCSfile: valueset.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: vg $ $Date: 2002-11-21 12:50:41 $ + * last change: $Author: af $ $Date: 2002-11-25 12:49:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2190,20 +2190,23 @@ void ValueSet::SelectItem( USHORT nItemId ) } // focus event (select) - if( mnSelItemId ) + if (mnSelItemId >= 0) { const USHORT nPos = GetItemPos( mnSelItemId ); + ValueSetItem* pItem; if( nPos != VALUESET_ITEM_NOTFOUND ) - { - ValueItemAcc* pItemAcc = ValueItemAcc::getImplementation( mpItemList->GetObject( nPos )->GetAccessible() ); + pItem = mpItemList->GetObject(nPos); + else + pItem = mpNoneItem; - if( pItemAcc ) - { - ::com::sun::star::uno::Any aOldAny, aNewAny; - aNewAny <<= ::drafts::com::sun::star::accessibility::AccessibleStateType::FOCUSED; - pItemAcc->FireAccessibleEvent( ::drafts::com::sun::star::accessibility::AccessibleEventId::ACCESSIBLE_STATE_EVENT, aOldAny, aNewAny ); - } + ValueItemAcc* pItemAcc = ValueItemAcc::getImplementation(pItem->GetAccessible() ); + + if( pItemAcc ) + { + ::com::sun::star::uno::Any aOldAny, aNewAny; + aNewAny <<= ::drafts::com::sun::star::accessibility::AccessibleStateType::FOCUSED; + pItemAcc->FireAccessibleEvent( ::drafts::com::sun::star::accessibility::AccessibleEventId::ACCESSIBLE_STATE_EVENT, aOldAny, aNewAny ); } } |