From e7a34dbaec716fb441f09007b150c7be54e3b013 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 7 Apr 2025 13:28:29 +0100 Subject: [PATCH] wina11y: Simplify SELECTION_CHANGED_* handlers a bit Drop the unused `oldValue` param from the methods handling the SELECTION_CHANGED_* events, and make them non-virtual, as they don't need to be overriden in any subclass. Change-Id: Ic4a248a6dedaa0a6b25b22dd5673be2bb27a4fc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183791 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- .../inc/AccDescendantManagerEventListener.hxx | 9 +++------ .../service/AccDescendantManagerEventListener.cxx | 12 ++++++------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/winaccessibility/inc/AccDescendantManagerEventListener.hxx b/winaccessibility/inc/AccDescendantManagerEventListener.hxx index 2795e1b68ab3..0438925a7bb8 100644 --- a/winaccessibility/inc/AccDescendantManagerEventListener.hxx +++ b/winaccessibility/inc/AccDescendantManagerEventListener.hxx @@ -54,12 +54,9 @@ public: bool NotifyChildEvent(UnoMSAAEvent eWinEvent, const css::uno::Any& Value); - virtual void HandleSelectionChangedAddEvent( - const css::uno::Any &oldValue, const css::uno::Any &newValue); - virtual void HandleSelectionChangedRemoveEvent( - const css::uno::Any &oldValue, const css::uno::Any &newValue); - virtual void HandleSelectionChangedWithinEvent( - const css::uno::Any &oldValue, const css::uno::Any &newValue); + void HandleSelectionChangedAddEvent(const css::uno::Any& newValue); + void HandleSelectionChangedRemoveEvent(const css::uno::Any& newValue); + void HandleSelectionChangedWithinEvent(const css::uno::Any& newValue); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/winaccessibility/source/service/AccDescendantManagerEventListener.cxx b/winaccessibility/source/service/AccDescendantManagerEventListener.cxx index 45f3f4eb6684..14241425d2d1 100644 --- a/winaccessibility/source/service/AccDescendantManagerEventListener.cxx +++ b/winaccessibility/source/service/AccDescendantManagerEventListener.cxx @@ -57,13 +57,13 @@ void AccDescendantManagerEventListener::notifyEvent( const css::accessibility:: HandleChildChangedNoFocusEvent(aEvent.OldValue, aEvent.NewValue); break; case AccessibleEventId::SELECTION_CHANGED_ADD: - HandleSelectionChangedAddEvent(aEvent.OldValue, aEvent.NewValue); + HandleSelectionChangedAddEvent(aEvent.NewValue); break; case AccessibleEventId::SELECTION_CHANGED_REMOVE: - HandleSelectionChangedRemoveEvent(aEvent.OldValue, aEvent.NewValue); + HandleSelectionChangedRemoveEvent(aEvent.NewValue); break; case AccessibleEventId::SELECTION_CHANGED_WITHIN: - HandleSelectionChangedWithinEvent(aEvent.OldValue, aEvent.NewValue); + HandleSelectionChangedWithinEvent(aEvent.NewValue); break; default: AccComponentEventListener::notifyEvent(aEvent); @@ -167,7 +167,7 @@ bool AccDescendantManagerEventListener::NotifyChildEvent(UnoMSAAEvent eWinEvent, } return false; } -void AccDescendantManagerEventListener::HandleSelectionChangedAddEvent(const Any& /*oldValue*/, const Any &newValue) +void AccDescendantManagerEventListener::HandleSelectionChangedAddEvent(const Any& newValue) { if (NotifyChildEvent(UnoMSAAEvent::SELECTION_CHANGED_ADD, newValue)) { @@ -176,7 +176,7 @@ void AccDescendantManagerEventListener::HandleSelectionChangedAddEvent(const Any m_rObjManager.NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_ADD); } -void AccDescendantManagerEventListener::HandleSelectionChangedRemoveEvent(const Any& /*oldValue*/, const Any &newValue) +void AccDescendantManagerEventListener::HandleSelectionChangedRemoveEvent(const Any& newValue) { if (NotifyChildEvent(UnoMSAAEvent::SELECTION_CHANGED_REMOVE, newValue)) { @@ -185,7 +185,7 @@ void AccDescendantManagerEventListener::HandleSelectionChangedRemoveEvent(const m_rObjManager.NotifyAccEvent(m_xAccessible.get(), UnoMSAAEvent::SELECTION_CHANGED_REMOVE); } -void AccDescendantManagerEventListener::HandleSelectionChangedWithinEvent(const Any& /*oldValue*/, const Any &newValue) +void AccDescendantManagerEventListener::HandleSelectionChangedWithinEvent(const Any& newValue) { if (NotifyChildEvent(UnoMSAAEvent::SELECTION_CHANGED_WITHIN, newValue)) {