chart2/source/controller/accessibility/AccessibleBase.cxx | 23 +++--------- chart2/source/controller/inc/AccessibleBase.hxx | 6 --- editeng/source/accessibility/AccessibleEditableTextPara.cxx | 4 -- include/vcl/unohelp.hxx | 1 sc/source/ui/Accessibility/AccessibleContextBase.cxx | 4 -- svx/source/accessibility/AccessibleTextHelper.cxx | 4 -- vcl/source/app/unohelp.cxx | 19 --------- 7 files changed, 8 insertions(+), 53 deletions(-)
New commits: commit dadc8a8771645d475b6287dd4c65b88cdad81d93 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Mar 18 12:01:06 2022 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Mar 18 13:21:12 2022 +0100 a11y: Drop vcl::unohelper::NotifyAccessibleStateEventGlobally As mentioned in Change-Id I4681c28c9d18cf1953be5127765f4aa94563662d ("chart a11y: Drop bSendGlobally param from AccessibleBase::BroadcastAccEvent"), calling it has no effect, the `fireFocusGained` and `fireFocusLost` methods of the `XExtendedToolkit` interface in its only implementation in `VCLXToolkit` do nothing, so just drop it. Change-Id: Ie9352a4e4021d7bf0b35de71f55afc660795b906 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131736 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 22576523f9e6..cf605db6c4eb 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -560,10 +560,6 @@ namespace accessibility AccessibleEventObject aEvent(xThis, nEventId, rNewValue, rOldValue); - // #102261# Call global queue for focus events - if( nEventId == AccessibleEventId::STATE_CHANGED ) - vcl::unohelper::NotifyAccessibleStateEventGlobally( aEvent ); - // #106234# Delegate to EventNotifier if( getNotifierClientId() != -1 ) ::comphelper::AccessibleEventNotifier::addEvent( getNotifierClientId(), diff --git a/include/vcl/unohelp.hxx b/include/vcl/unohelp.hxx index 5ba919edd577..c7b9dcc06956 100644 --- a/include/vcl/unohelp.hxx +++ b/include/vcl/unohelp.hxx @@ -37,7 +37,6 @@ namespace vcl::unohelper { VCL_DLLPUBLIC css::uno::Reference < css::i18n::XBreakIterator > CreateBreakIterator(); css::uno::Reference < css::i18n::XCharacterClassification> CreateCharacterClassification(); -VCL_DLLPUBLIC void NotifyAccessibleStateEventGlobally( const css::accessibility::AccessibleEventObject& rEventObject ); VCL_DLLPUBLIC float ConvertFontWidth( FontWidth eWidth ); VCL_DLLPUBLIC FontWidth ConvertFontWidth( float f ); VCL_DLLPUBLIC float ConvertFontWeight( FontWeight eWeight ); diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 38620240baaf..cdbb5ea71494 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -474,8 +474,6 @@ void ScAccessibleContextBase::CommitFocusGained() const aEvent.NewValue <<= AccessibleStateType::FOCUSED; CommitChange(aEvent); - - vcl::unohelper::NotifyAccessibleStateEventGlobally(aEvent); } void ScAccessibleContextBase::CommitFocusLost() const @@ -486,8 +484,6 @@ void ScAccessibleContextBase::CommitFocusLost() const aEvent.OldValue <<= AccessibleStateType::FOCUSED; CommitChange(aEvent); - - vcl::unohelper::NotifyAccessibleStateEventGlobally(aEvent); } tools::Rectangle ScAccessibleContextBase::GetBoundingBoxOnScreen() const diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 046fec99224b..3331a88e552c 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -1410,10 +1410,6 @@ namespace accessibility void AccessibleTextHelper_Impl::FireEvent( const AccessibleEventObject& rEvent ) const { - // #102261# Call global queue for focus events - if( rEvent.EventId == AccessibleStateType::FOCUSED ) - vcl::unohelper::NotifyAccessibleStateEventGlobally( rEvent ); - // #106234# Delegate to EventNotifier ::comphelper::AccessibleEventNotifier::addEvent( getNotifierClientId(), rEvent ); diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx index f08e54131259..89b526c91ffa 100644 --- a/vcl/source/app/unohelp.cxx +++ b/vcl/source/app/unohelp.cxx @@ -45,25 +45,6 @@ uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacte return i18n::CharacterClassification::create( comphelper::getProcessComponentContext() ); } -void vcl::unohelper::NotifyAccessibleStateEventGlobally( const css::accessibility::AccessibleEventObject& rEventObject ) -{ - css::uno::Reference< css::awt::XExtendedToolkit > xExtToolkit( Application::GetVCLToolkit(), uno::UNO_QUERY ); - if ( !xExtToolkit.is() ) - return; - - // Only for focus events - sal_Int16 nType = css::accessibility::AccessibleStateType::INVALID; - rEventObject.NewValue >>= nType; - if ( nType == css::accessibility::AccessibleStateType::FOCUSED ) - xExtToolkit->fireFocusGained( rEventObject.Source ); - else - { - rEventObject.OldValue >>= nType; - if ( nType == css::accessibility::AccessibleStateType::FOCUSED ) - xExtToolkit->fireFocusLost( rEventObject.Source ); - } -} - float vcl::unohelper::ConvertFontWidth( FontWidth eWidth ) { if( eWidth == WIDTH_DONTKNOW ) commit fe09f12d83d934287c58f507a99b693212a84c79 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Mar 18 11:46:46 2022 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Mar 18 13:21:00 2022 +0100 chart a11y: Drop bSendGlobally param from AccessibleBase::BroadcastAccEvent Setting it didn't have any effect in practice: If set to `true`, it resulted in `vcl::unohelper::NotifyAccessibleStateEventGlobally` getting called, which calls `XExtendedToolkit::fireFocusGained` or `XExtendedToolkit::fireFocusLost`, but the only implementations in `VCLXToolkit` do nothing. Interestingly, the documentation for `XExtendedToolkit` in `offapi/com/sun/star/awt/XExtendedToolkit.idl` says: > @deprecated > This interface was only implemented in an intermediate developer > release anyway. > > @since OOo 1.1.2 but the interface is still used in various places across the code base... Change-Id: I4681c28c9d18cf1953be5127765f4aa94563662d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131735 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index f419ba7f7942..904c91e99365 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -123,7 +123,7 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId AddState( AccessibleStateType::FOCUSED ); aSelected <<= AccessibleStateType::FOCUSED; - BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty, true ); + BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aSelected, aEmpty ); SAL_INFO("chart2.accessibility", "Selection acquired by: " << getAccessibleName()); } @@ -136,7 +136,7 @@ bool AccessibleBase::NotifyEvent( EventType eEventType, const AccessibleUniqueId AddState( AccessibleStateType::FOCUSED ); aSelected <<= AccessibleStateType::FOCUSED; - BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected, true ); + BroadcastAccEvent( AccessibleEventId::STATE_CHANGED, aEmpty, aSelected ); SAL_INFO("chart2.accessibility", "Selection lost by: " << getAccessibleName()); } break; @@ -343,32 +343,24 @@ awt::Point AccessibleBase::GetUpperLeftOnScreen() const void AccessibleBase::BroadcastAccEvent( sal_Int16 nId, const Any & rNew, - const Any & rOld, - bool bSendGlobally ) const + const Any & rOld ) const { ClearableMutexGuard aGuard( m_aMutex ); - if ( !m_nEventNotifierId && !bSendGlobally ) + if ( !m_nEventNotifierId ) return; // 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 - //except SendGlobally for focus handling? // the const cast is needed, because UNO parameters are never const const AccessibleEventObject aEvent( const_cast< uno::XWeak * >( static_cast< const uno::XWeak * >( this )), nId, rNew, rOld ); - if ( m_nEventNotifierId ) // let the notifier handle this event - ::comphelper::AccessibleEventNotifier::addEvent( m_nEventNotifierId, aEvent ); + // let the notifier handle this event + ::comphelper::AccessibleEventNotifier::addEvent( m_nEventNotifierId, aEvent ); aGuard.clear(); - - // send event to global message queue - if( bSendGlobally ) - { - vcl::unohelper::NotifyAccessibleStateEventGlobally( aEvent ); - } } void AccessibleBase::KillAllChildren() @@ -405,8 +397,7 @@ void AccessibleBase::SetInfo( const AccessibleElementInfo & rNewInfo ) { KillAllChildren(); } - BroadcastAccEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, uno::Any(), uno::Any(), - true /* global notification */ ); + BroadcastAccEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, uno::Any(), uno::Any()); } // ________ (XComponent::dispose) ________ diff --git a/chart2/source/controller/inc/AccessibleBase.hxx b/chart2/source/controller/inc/AccessibleBase.hxx index 4bd51c342678..44f326f2a4f1 100644 --- a/chart2/source/controller/inc/AccessibleBase.hxx +++ b/chart2/source/controller/inc/AccessibleBase.hxx @@ -185,14 +185,10 @@ protected: /** This method creates an AccessibleEventObject and sends it to all listeners that are currently listening to this object - - If bSendGlobally is true, the event is also broadcast via - vcl::unohelper::NotifyAccessibleStateEventGlobally() */ void BroadcastAccEvent( sal_Int16 nId, const css::uno::Any & rNew, - const css::uno::Any & rOld, - bool bSendGlobally = false ) const; + const css::uno::Any & rOld ) const; /** Removes all children from the internal lists and broadcasts child remove events.