summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-08-16 19:07:54 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2023-08-18 06:04:44 +0200
commiteb812cb94f20dd04fa4cf3ec89df8bb813811359 (patch)
tree7c009f39f67111ca80c443915128839463463435
parent756febf9a889cc969c3c7812806ef999d0befb95 (diff)
Rename Window::ImplIsAccessibleNativeFrame and make it public
The way to determine whether this window is a "native frame" doesn't look particularly specific to a11y, so rename it to just `Window::IsNativeFrame` and make it public in order to reuse it in a follow-up commit. Also move the implementation out of the source file that implements accessibility-specific Window methods for consistency. Change-Id: I980f251cacce6a601e86fc6261a231b799b30317 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155798 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--include/vcl/window.hxx2
-rw-r--r--vcl/source/window/accessibility.cxx18
-rw-r--r--vcl/source/window/window.cxx2
-rw-r--r--vcl/source/window/window2.cxx12
4 files changed, 17 insertions, 17 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 2d64be451370..0f9c6f3f45b5 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -779,6 +779,7 @@ public:
bool IsDialog() const;
bool IsMenuFloatingWindow() const;
bool IsToolbarFloatingWindow() const;
+ bool IsNativeFrame() const;
bool IsTopWindow() const;
SystemWindow* GetSystemWindow() const;
@@ -1187,7 +1188,6 @@ protected:
private:
SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const;
- SAL_DLLPRIVATE bool ImplIsAccessibleNativeFrame() const;
///@}
/*
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 0656720b6986..3c6103ac31d9 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -95,24 +95,12 @@ bool Window::ImplIsAccessibleCandidate() const
if( !mpWindowImpl->mbBorderWin )
return true;
- return ImplIsAccessibleNativeFrame();
-}
-
-bool Window::ImplIsAccessibleNativeFrame() const
-{
- if( mpWindowImpl->mbFrame )
- // #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menus!) are closeable
- if( mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) )
- return true;
- else
- return false;
- else
- return false;
+ return IsNativeFrame();
}
vcl::Window* Window::GetAccessibleParentWindow() const
{
- if (!mpWindowImpl || ImplIsAccessibleNativeFrame())
+ if (!mpWindowImpl || IsNativeFrame())
return nullptr;
vcl::Window* pParent = mpWindowImpl->mpParent;
@@ -327,7 +315,7 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
case WindowType::BORDERWINDOW:
case WindowType::SYSTEMCHILDWINDOW:
default:
- if (ImplIsAccessibleNativeFrame() )
+ if (IsNativeFrame() )
nRole = accessibility::AccessibleRole::FRAME;
else if( IsScrollable() )
nRole = accessibility::AccessibleRole::SCROLL_PANE;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f7920f793f43..869516b45902 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -157,7 +157,7 @@ void Window::dispose()
CallEventListeners( VclEventId::ObjectDying );
// do not send child events for frames that were registered as native frames
- if( !ImplIsAccessibleNativeFrame() && mpWindowImpl->mbReallyVisible )
+ if( !IsNativeFrame() && mpWindowImpl->mbReallyVisible )
if ( ImplIsAccessibleCandidate() && GetAccessibleParentWindow() )
GetAccessibleParentWindow()->CallEventListeners( VclEventId::WindowChildDestroyed, this );
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 5e9ffd2ef529..c9720139585d 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1040,6 +1040,18 @@ bool Window::IsToolbarFloatingWindow() const
return mpWindowImpl && mpWindowImpl->mbToolbarFloatingWindow;
}
+bool Window::IsNativeFrame() const
+{
+ if( mpWindowImpl->mbFrame )
+ // #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menus!) are closeable
+ if( mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) )
+ return true;
+ else
+ return false;
+ else
+ return false;
+}
+
void Window::EnableAllResize()
{
mpWindowImpl->mbAllResize = true;