From 151eb21f7a5e14df0d3367466b150afd2571bddd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 2 Sep 2023 14:57:53 +0200 Subject: use more concrete type in AccessibleTableShapeImpl Change-Id: I6acc54c1c178815805fc1a724ad4c00b17a5ed6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156472 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/table/accessibletableshape.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'svx') diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx index cc3a8e90b7f3..f1cedcd3a0ca 100644 --- a/svx/source/table/accessibletableshape.cxx +++ b/svx/source/table/accessibletableshape.cxx @@ -62,7 +62,7 @@ class AccessibleTableShapeImpl : public cppu::WeakImplHelper< XModifyListener > public: explicit AccessibleTableShapeImpl( AccessibleShapeTreeInfo& rShapeTreeInfo ); - void init( const Reference< XAccessible>& xAccessible, const Reference< XTable >& xTable ); + void init( const rtl::Reference< AccessibleTableShape>& xAccessible, const Reference< XTable >& xTable ); void dispose(); /// @throws IndexOutOfBoundsException @@ -80,7 +80,7 @@ public: AccessibleShapeTreeInfo& mrShapeTreeInfo; Reference< XTable > mxTable; AccessibleCellMap maChildMap; - Reference< XAccessible> mxAccessible; + rtl::Reference< AccessibleTableShape> mxAccessible; sal_Int32 mRowCount, mColCount; //get the cached AccessibleCell from XCell rtl::Reference< AccessibleCell > getAccessibleCell (const Reference< XCell >& xCell); @@ -98,7 +98,7 @@ AccessibleTableShapeImpl::AccessibleTableShapeImpl( AccessibleShapeTreeInfo& rSh } -void AccessibleTableShapeImpl::init( const Reference< XAccessible>& xAccessible, const Reference< XTable >& xTable ) +void AccessibleTableShapeImpl::init( const rtl::Reference& xAccessible, const Reference< XTable >& xTable ) { mxAccessible = xAccessible; mxTable = xTable; @@ -109,7 +109,7 @@ void AccessibleTableShapeImpl::init( const Reference< XAccessible>& xAccessible, mxTable->addModifyListener( xListener ); //register the listener with table model Reference< css::view::XSelectionSupplier > xSelSupplier(xTable, UNO_QUERY); - Reference< css::view::XSelectionChangeListener > xSelListener( xAccessible, UNO_QUERY ); + Reference< css::view::XSelectionChangeListener > xSelListener( xAccessible ); if (xSelSupplier.is()) xSelSupplier->addSelectionChangeListener(xSelListener); mRowCount = mxTable->getRowCount(); @@ -303,9 +303,8 @@ void SAL_CALL AccessibleTableShapeImpl::modified( const EventObject& /*aEvent*/ rEntry.second->dispose(); } //notify bridge to update the acc cache. - AccessibleTableShape *pAccTable = dynamic_cast (mxAccessible.get()); - if (pAccTable) - pAccTable->CommitChange(AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any(), -1); + if (mxAccessible) + mxAccessible->CommitChange(AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any(), -1); } catch( const Exception& ) { -- cgit