include/vcl/accessibletable.hxx | 1 toolkit/inc/controls/table/AccessibleGridControlBase.hxx | 3 - toolkit/inc/controls/table/tablecontrol.hxx | 1 toolkit/source/controls/table/AccessibleGridControlBase.cxx | 24 +++++----- toolkit/source/controls/table/AccessibleGridControlTableCell.cxx | 3 - toolkit/source/controls/table/tablecontrol.cxx | 5 -- 6 files changed, 13 insertions(+), 24 deletions(-)
New commits: commit 3e447bcca78dec8c2b8f3499969641e008ad7e7f Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Jan 24 11:35:31 2025 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Jan 24 22:01:23 2025 +0100 toolkit a11y: Drop AccessibleGridControlBase::{g,s}etClientId The AccessibleGridControlBase::m_aClientId is (and should only be) used by the class itself, not by subclasses, so access the member directly and drop the protected getter and setter. Change-Id: I987cad89c7aec48fb0286d7b24e9b282db3b536c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180711 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/toolkit/inc/controls/table/AccessibleGridControlBase.hxx b/toolkit/inc/controls/table/AccessibleGridControlBase.hxx index e4a406cb6ebc..a5b961f2c88a 100644 --- a/toolkit/inc/controls/table/AccessibleGridControlBase.hxx +++ b/toolkit/inc/controls/table/AccessibleGridControlBase.hxx @@ -232,9 +232,6 @@ protected: /// @throws css::lang::DisposedException AbsoluteScreenPixelRectangle getBoundingBoxOnScreen(); - ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } - void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } - protected: // members diff --git a/toolkit/source/controls/table/AccessibleGridControlBase.cxx b/toolkit/source/controls/table/AccessibleGridControlBase.cxx index bafb961f6e56..9fc195a0b68c 100644 --- a/toolkit/source/controls/table/AccessibleGridControlBase.cxx +++ b/toolkit/source/controls/table/AccessibleGridControlBase.cxx @@ -74,10 +74,10 @@ void SAL_CALL AccessibleGridControlBase::disposing() { SolarMutexGuard g; - if ( getClientId( ) ) + if (m_aClientId) { - AccessibleEventNotifier::TClientId nId( getClientId( ) ); - setClientId( 0 ); + AccessibleEventNotifier::TClientId nId = m_aClientId; + m_aClientId = 0; AccessibleEventNotifier::revokeClientNotifyDisposing( nId, *this ); } @@ -217,30 +217,30 @@ void SAL_CALL AccessibleGridControlBase::addAccessibleEventListener( { SolarMutexGuard g; - if ( !getClientId( ) ) - setClientId( AccessibleEventNotifier::registerClient( ) ); + if (!m_aClientId) + m_aClientId = AccessibleEventNotifier::registerClient(); - AccessibleEventNotifier::addEventListener( getClientId( ), _rxListener ); + AccessibleEventNotifier::addEventListener(m_aClientId, _rxListener ); } } void SAL_CALL AccessibleGridControlBase::removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener>& _rxListener ) { - if( !(_rxListener.is() && getClientId( )) ) + if (!(_rxListener.is() && m_aClientId)) return; SolarMutexGuard g; - sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( getClientId( ), _rxListener ); + sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener(m_aClientId, _rxListener); 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 - AccessibleEventNotifier::TClientId nId( getClientId( ) ); - setClientId( 0 ); + AccessibleEventNotifier::TClientId nId = m_aClientId; + m_aClientId = 0; AccessibleEventNotifier::revokeClient( nId ); } } @@ -340,7 +340,7 @@ void AccessibleGridControlBase::commitEvent( { SolarMutexGuard g; - if ( !getClientId( ) ) + if (!m_aClientId) // if we don't have a client id for the notifier, then we don't have listeners, then // we don't need to notify anything return; @@ -350,7 +350,7 @@ void AccessibleGridControlBase::commitEvent( // let the notifier handle this event - AccessibleEventNotifier::addEvent( getClientId( ), aEvent ); + AccessibleEventNotifier::addEvent(m_aClientId, aEvent); } sal_Int16 SAL_CALL AccessibleGridControlBase::getAccessibleRole() commit d38bb9e0a9a192ccc6f5c71c9e173cc95e709119 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Jan 24 10:43:39 2025 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Jan 24 22:01:11 2025 +0100 toolkit a11y: Port away from TableControl::GetFieldIndexAtPoint Same as Change-Id: Ib2c799cdb5f8f8515ee771b241e1fd8567dc967d Author: Michael Weghorn <m.wegh...@posteo.de> Date: Fri Jan 24 10:40:53 2025 +0100 toolkit a11y: Port away from TableControl::GetFieldCharacterBounds , but for TableControl::GetFieldIndexAtPoint. Change-Id: I359376532e8e80e001e6c286ee4fdd3d7a3ea2f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180710 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/include/vcl/accessibletable.hxx b/include/vcl/accessibletable.hxx index 7c750c2166ef..467aa8262149 100644 --- a/include/vcl/accessibletable.hxx +++ b/include/vcl/accessibletable.hxx @@ -80,7 +80,6 @@ public: virtual tools::Rectangle calcHeaderCellRect( bool _bColHeader, sal_Int32 _nPos ) = 0; virtual tools::Rectangle calcTableRect() = 0; virtual tools::Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) = 0; - virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint)= 0; virtual void FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const= 0; virtual OUString GetRowName(sal_Int32 _nIndex) const = 0; virtual OUString GetColumnName( sal_Int32 _nIndex ) const = 0; diff --git a/toolkit/inc/controls/table/tablecontrol.hxx b/toolkit/inc/controls/table/tablecontrol.hxx index 390da80cb9c7..4b08ab023f64 100644 --- a/toolkit/inc/controls/table/tablecontrol.hxx +++ b/toolkit/inc/controls/table/tablecontrol.hxx @@ -134,7 +134,6 @@ namespace svt::table virtual tools::Rectangle calcHeaderCellRect( bool _bIsColumnBar, sal_Int32 nPos) override; virtual tools::Rectangle calcTableRect() override; virtual tools::Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) override; - virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override; virtual void FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const override; virtual OUString GetRowName(sal_Int32 _nIndex) const override; virtual OUString GetColumnName( sal_Int32 _nIndex ) const override; diff --git a/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx b/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx index 79b21c0b326a..3c4af9890916 100644 --- a/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx +++ b/toolkit/source/controls/table/AccessibleGridControlTableCell.cxx @@ -148,8 +148,7 @@ namespace accessibility ensureIsAlive(); - return m_aTable.GetFieldIndexAtPoint(getRowPos(), getColumnPos(), - vcl::unohelper::ConvertToVCLPoint(_aPoint)); + return m_aTable.GetIndexForPoint(vcl::unohelper::ConvertToVCLPoint(_aPoint)); } /** @return diff --git a/toolkit/source/controls/table/tablecontrol.cxx b/toolkit/source/controls/table/tablecontrol.cxx index f9cdbc8ef545..4caccefa4d09 100644 --- a/toolkit/source/controls/table/tablecontrol.cxx +++ b/toolkit/source/controls/table/tablecontrol.cxx @@ -585,11 +585,6 @@ namespace svt::table _rStateSet |= AccessibleStateType::ACTIVE; } - sal_Int32 TableControl::GetFieldIndexAtPoint(sal_Int32,sal_Int32,const Point& _rPoint) - { - return GetIndexForPoint(_rPoint); - } - tools::Rectangle TableControl::calcHeaderRect(bool _bIsColumnBar ) {