diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-10-02 19:57:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-10-03 14:07:57 +0200 |
commit | 9b26255f03d6049bb9c7eeed4b63da070849d7be (patch) | |
tree | 0f580e8eea9e0cd2eb98c3aea6c6ac20393c4e53 /svtools | |
parent | 760686f8810b1a2a742b3a51063e12fb51b0323b (diff) |
use more concrete UNO class in ValueSetAcc
Change-Id: I9d6c31ccda4ff05f33d437ab064a2a55d84627b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174411
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/valueacc.cxx | 9 | ||||
-rw-r--r-- | svtools/source/control/valueimp.hxx | 5 | ||||
-rw-r--r-- | svtools/source/control/valueset.cxx | 21 |
3 files changed, 12 insertions, 23 deletions
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index cec532a39a71..f29da058aa4e 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -53,7 +53,7 @@ ValueSetItem::~ValueSetItem() } } -uno::Reference< accessibility::XAccessible > ValueSetItem::GetAccessible( bool bIsTransientChildrenDisabled ) +rtl::Reference< ValueItemAcc > ValueSetItem::GetAccessible( bool bIsTransientChildrenDisabled ) { if( !mxAcc.is() ) mxAcc = new ValueItemAcc( this, bIsTransientChildrenDisabled ); @@ -77,13 +77,6 @@ void ValueItemAcc::ParentDestroyed() mpParent = nullptr; } -ValueItemAcc* ValueItemAcc::getImplementation( const uno::Reference< uno::XInterface >& rxData ) - noexcept -{ - return dynamic_cast<ValueItemAcc*>(rxData.get()); -} - - uno::Reference< accessibility::XAccessibleContext > SAL_CALL ValueItemAcc::getAccessibleContext() { return this; diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx index 61e849cc1acd..f0902c8efdd9 100644 --- a/svtools/source/control/valueimp.hxx +++ b/svtools/source/control/valueimp.hxx @@ -61,8 +61,7 @@ struct ValueSetItem explicit ValueSetItem( ValueSet& rParent ); ~ValueSetItem(); - css::uno::Reference< css::accessibility::XAccessible > - GetAccessible( bool bIsTransientChildrenDisabled ); + rtl::Reference< ValueItemAcc > GetAccessible( bool bIsTransientChildrenDisabled ); }; typedef comphelper::WeakComponentImplHelper< @@ -206,8 +205,6 @@ public: void FireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue ); - static ValueItemAcc* getImplementation( const css::uno::Reference< css::uno::XInterface >& rxData ) noexcept; - public: // XAccessible diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index c80fc3f3e69a..05988353341a 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -142,7 +142,7 @@ void ValueSet::ImplDeleteItems() Any aOldAny; Any aNewAny; - aOldAny <<= pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ ); + aOldAny <<= Reference< XAccessible >(pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/ )); ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny); } @@ -792,14 +792,14 @@ void ValueSet::SelectItem( sal_uInt16 nItemId ) if( nPos != VALUESET_ITEM_NOTFOUND ) { - ValueItemAcc* pItemAcc = ValueItemAcc::getImplementation( - mItemList[nPos]->GetAccessible( false/*bIsTransientChildrenDisabled*/ ) ); + rtl::Reference<ValueItemAcc> pItemAcc = + mItemList[nPos]->GetAccessible( false/*bIsTransientChildrenDisabled*/ ); if( pItemAcc ) { Any aOldAny; Any aNewAny; - aOldAny <<= Reference(getXWeak(pItemAcc)); + aOldAny <<= Reference(getXWeak(pItemAcc.get())); ImplFireAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny ); } } @@ -818,8 +818,8 @@ void ValueSet::SelectItem( sal_uInt16 nItemId ) ValueItemAcc* pItemAcc = nullptr; if (pItem != nullptr) - pItemAcc = ValueItemAcc::getImplementation( - pItem->GetAccessible(false /*bIsTransientChildrenDisabled*/)); + pItemAcc = + pItem->GetAccessible(false /*bIsTransientChildrenDisabled*/).get(); if (pItemAcc) { @@ -1109,7 +1109,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) Any aOldAny; Any aNewAny; - aNewAny <<= pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/); + aNewAny <<= Reference<XAccessible>(pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/)); ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny); } @@ -1131,7 +1131,7 @@ void ValueSet::Format(vcl::RenderContext const & rRenderContext) Any aOldAny; Any aNewAny; - aOldAny <<= pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/); + aOldAny <<= Reference<XAccessible>(pItem->GetAccessible(false/*bIsTransientChildrenDisabled*/)); ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny); } @@ -1907,9 +1907,8 @@ void ValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText) if (ImplHasAccessibleListeners()) { - Reference<XAccessible> xAccessible(pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/)); - ValueItemAcc* pValueItemAcc = static_cast<ValueItemAcc*>(xAccessible.get()); - pValueItemAcc->FireAccessibleEvent(AccessibleEventId::NAME_CHANGED, aOldName, aNewName); + rtl::Reference<ValueItemAcc> xAccessible(pItem->GetAccessible( false/*bIsTransientChildrenDisabled*/)); + xAccessible->FireAccessibleEvent(AccessibleEventId::NAME_CHANGED, aOldName, aNewName); } } |