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 */