From b537e5b6d50988458aca8893393451d2c3d255e9 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 2 Dec 2024 04:27:33 +0100 Subject: [PATCH] Drop Window::IsAccessibilityEventsSuppressed param All callers use the default of `true` for the `bTraverseParentPath` param since Change-Id: I88fe0e6ec9bb693710e3f7ab0c6c2e46686be720 Author: Michael Weghorn Date: Mon Dec 2 03:28:50 2024 +0100 sc a11y: Don't suppress a11y events when setting new pos , so simplify this by dropping the param altogether. Change-Id: If47333f096d31afc3fb2c57dcc03d8e342ae4aa5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177640 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/window.hxx | 4 ++-- vcl/source/window/accessibility.cxx | 21 ++++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 1c4486b0faf7..008415417350 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1160,8 +1160,8 @@ public: vcl::Window* GetAccessibleRelationMemberOf() const; // to avoid sending accessibility events in cases like closing dialogs - // by default checks complete parent path - bool IsAccessibilityEventsSuppressed( bool bTraverseParentPath = true ); + // checks complete parent path + bool IsAccessibilityEventsSuppressed(); KeyEvent GetActivationKey() const; diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index afeea0e23067..0015507f66f6 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -606,22 +606,17 @@ vcl::Window* Window::GetAccessibleRelationLabeledBy() const return nullptr; } -bool Window::IsAccessibilityEventsSuppressed( bool bTraverseParentPath ) +bool Window::IsAccessibilityEventsSuppressed() { - if( !bTraverseParentPath ) - return mpWindowImpl->mbSuppressAccessibilityEvents; - else + vcl::Window *pParent = this; + while (pParent && pParent->mpWindowImpl) { - vcl::Window *pParent = this; - while ( pParent && pParent->mpWindowImpl) - { - if( pParent->mpWindowImpl->mbSuppressAccessibilityEvents ) - return true; - else - pParent = pParent->mpWindowImpl->mpParent; // do not use GetParent() to find borderwindows that are frames - } - return false; + if (pParent->mpWindowImpl->mbSuppressAccessibilityEvents) + return true; + else + pParent = pParent->mpWindowImpl->mpParent; // do not use GetParent() to find borderwindows that are frames } + return false; } } /* namespace vcl */