From 129e395935bf7330a1fe84986dd78502af36e07e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 30 Aug 2023 12:29:48 +0200 Subject: make IAccessibleBrowseBox extend cppu::WeakImplHelper i.e. push this up from the implementation class AccessibleBrowseBoxAccess to the interface class. Which means we don't need the getMyself helper method, and make the memory management simpler. Change-Id: Icecb83834bb3f5304908bbd3682b3d2ea06dbfe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156285 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svtools/source/brwbox/brwbox3.cxx | 8 ++------ svtools/source/brwbox/brwimpl.hxx | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'svtools') diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index 4a5a8531e6ac..32ab1807ac69 100644 --- a/svtools/source/brwbox/brwbox3.cxx +++ b/svtools/source/brwbox/brwbox3.cxx @@ -97,11 +97,7 @@ Reference< XAccessible > BrowseBox::CreateAccessible() } } - Reference< XAccessible > xAccessible; - if ( m_pImpl->m_pAccessible ) - xAccessible = m_pImpl->m_pAccessible->getMyself(); - - return xAccessible; + return m_pImpl->m_pAccessible; } @@ -427,7 +423,7 @@ void BrowseBox::commitBrowseBoxEvent( sal_Int16 _nEventId, const Any& _rNewValue bool BrowseBox::isAccessibleAlive( ) const { - return ( nullptr != m_pImpl->m_pAccessible ) && m_pImpl->m_pAccessible->isAlive(); + return m_pImpl->m_pAccessible && m_pImpl->m_pAccessible->isAlive(); } // IAccessibleTableProvider diff --git a/svtools/source/brwbox/brwimpl.hxx b/svtools/source/brwbox/brwimpl.hxx index e822d7ef52c2..8c7017675a3f 100644 --- a/svtools/source/brwbox/brwimpl.hxx +++ b/svtools/source/brwbox/brwimpl.hxx @@ -55,12 +55,12 @@ namespace svt public: vcl::AccessibleFactoryAccess m_aFactoryAccess; - vcl::IAccessibleBrowseBox* m_pAccessible; + rtl::Reference m_pAccessible; THeaderCellMap m_aColHeaderCellMap; THeaderCellMap m_aRowHeaderCellMap; public: - BrowseBoxImpl() : m_pAccessible(nullptr) + BrowseBoxImpl() { } -- cgit v1.2.3