chart2/source/controller/accessibility/AccessibleTextHelper.cxx | 9 +--- svx/source/accessibility/AccessibleTextHelper.cxx | 21 ++++------ 2 files changed, 14 insertions(+), 16 deletions(-)
New commits: commit bcbee8ad61937e17d065dfd13f69e459c0c634c1 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Apr 29 17:32:24 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Apr 29 23:09:36 2025 +0200 chart a11y: Drop extra assignment to local var Change-Id: I8a5fccd35a707e84c6638bf1ee3d3a488cd413cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184787 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx index a8ad58ad61eb..6e7f6b7650af 100644 --- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx +++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx @@ -67,13 +67,12 @@ void AccessibleTextHelper::initialize( const OUString& aCID, if( pWindow ) { - SdrView * pView = m_pDrawViewWrapper; - if( pView ) + if (m_pDrawViewWrapper) { SdrObject * pTextObj = m_pDrawViewWrapper->getNamedSdrObject( aCID ); if( pTextObj ) { - m_oTextHelper.emplace( std::make_unique<SvxTextEditSource>(*pTextObj, nullptr, *pView, *pWindow->GetOutDev()) ); + m_oTextHelper.emplace(std::make_unique<SvxTextEditSource>(*pTextObj, nullptr, *m_pDrawViewWrapper, *pWindow->GetOutDev())); m_oTextHelper->SetEventSource( xEventSource ); } } commit 83ab114452b78a91fb1eb2440a7db2d27566eb3e Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Apr 29 17:29:04 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Apr 29 23:09:13 2025 +0200 chart2 a11y: Switch OSL_ENSURE -> assert ... and drop the additional check. The only caller AccessibleChartElement::InitTextEdit passes (always non-null) `this`. Change-Id: I218dc224eb6bad827fce66db02706bb555831a8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184786 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx index 15112a674a83..a8ad58ad61eb 100644 --- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx +++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx @@ -57,8 +57,8 @@ void AccessibleTextHelper::initialize( const OUString& aCID, vcl::Window* pWindow) { OSL_ENSURE( !aCID.isEmpty(), "Empty CID" ); - OSL_ENSURE( xEventSource.is(), "Empty Event Source" ); - if( !xEventSource.is() || aCID.isEmpty() ) + assert(xEventSource.is() && "Empty Event Source"); + if (aCID.isEmpty()) return; SolarMutexGuard aSolarGuard; commit a7f0972c2fc7195f9e1c2f0adaf2a33ff5ae61a8 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Apr 29 17:19:22 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Apr 29 23:08:45 2025 +0200 svx a11y: Drop private AccessibleTextHelper_Impl::getNotifierClientId Use the AccessibleTextHelper_Impl::mnNotifierClientId member directly instead. (That also aligns this a bit more with OAccessibleComponentHelper, which is used as a base class for most XAccessibleEventBroadcaster implementations.) Change-Id: Ib470d14f0c63bd262bb9ebf869c9b120c23236e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184785 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index fe5cddb71b51..31728a831e5a 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -164,8 +164,6 @@ private: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; - comphelper::AccessibleEventNotifier::TClientId getNotifierClientId() const { return mnNotifierClientId; } - // lock solar mutex before SvxTextForwarder& GetTextForwarder() const; // lock solar mutex before @@ -1363,12 +1361,12 @@ void AccessibleTextHelper_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& void AccessibleTextHelper_Impl::Dispose() { - if( getNotifierClientId() != snNotifierClientRevoked) + if (mnNotifierClientId != snNotifierClientRevoked) { try { // #106234# Unregister from EventNotifier - ::comphelper::AccessibleEventNotifier::revokeClient( getNotifierClientId() ); + ::comphelper::AccessibleEventNotifier::revokeClient(mnNotifierClientId); SAL_INFO("svx", "disposed ID: " << mnNotifierClientId ); } catch( const uno::Exception& ) {} @@ -1421,8 +1419,8 @@ void AccessibleTextHelper_Impl::FireEvent( const sal_Int16 nEventId, const uno:: void AccessibleTextHelper_Impl::FireEvent( const AccessibleEventObject& rEvent ) const { // #106234# Delegate to EventNotifier - if (getNotifierClientId() != snNotifierClientRevoked) - ::comphelper::AccessibleEventNotifier::addEvent( getNotifierClientId(), rEvent ); + if (mnNotifierClientId != snNotifierClientRevoked) + ::comphelper::AccessibleEventNotifier::addEvent(mnNotifierClientId, rEvent); } // XAccessibleContext @@ -1451,23 +1449,24 @@ uno::Reference< XAccessible > AccessibleTextHelper_Impl::getAccessibleChild( sal void AccessibleTextHelper_Impl::addAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) { - if( getNotifierClientId() != snNotifierClientRevoked ) - ::comphelper::AccessibleEventNotifier::addEventListener( getNotifierClientId(), xListener ); + if (mnNotifierClientId != snNotifierClientRevoked) + ::comphelper::AccessibleEventNotifier::addEventListener(mnNotifierClientId, xListener); } void AccessibleTextHelper_Impl::removeAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) { - if( getNotifierClientId() == snNotifierClientRevoked ) + if (mnNotifierClientId == snNotifierClientRevoked) return; - const sal_Int32 nListenerCount = ::comphelper::AccessibleEventNotifier::removeEventListener( getNotifierClientId(), xListener ); + const sal_Int32 nListenerCount + = ::comphelper::AccessibleEventNotifier::removeEventListener(mnNotifierClientId, xListener); if ( !nListenerCount ) { // no listeners anymore // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), // and at least to us not firing any events anymore, in case somebody calls // NotifyAccessibleEvent, again - ::comphelper::AccessibleEventNotifier::TClientId nId( getNotifierClientId() ); + ::comphelper::AccessibleEventNotifier::TClientId nId = mnNotifierClientId; mnNotifierClientId = snNotifierClientRevoked; ::comphelper::AccessibleEventNotifier::revokeClient( nId ); }