summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/window.hxx2
-rw-r--r--vcl/source/window/accessibility.cxx4
-rw-r--r--vcl/source/window/builder.cxx3
-rw-r--r--vcl/source/window/dlgctrl.cxx6
-rw-r--r--vcl/source/window/stacking.cxx2
-rw-r--r--vcl/source/window/window2.cxx4
6 files changed, 10 insertions, 11 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index c6e560baeb95..3227d6d6c038 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -555,7 +555,7 @@ public:
SalFrame* ImplGetFrame() const;
SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
- vcl::Window* ImplGetWindow();
+ vcl::Window* ImplGetWindow() const; ///< if this is a proxy return the client, otherwise itself
SAL_DLLPRIVATE ImplWinData* ImplGetWinData() const;
SAL_DLLPRIVATE vcl::Window* ImplGetClientWindow() const;
SAL_DLLPRIVATE vcl::Window* ImplGetDlgWindow( sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = nullptr );
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 947ddd87a7bd..6802b1a604f7 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -397,7 +397,7 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
nRole = accessibility::AccessibleRole::FRAME;
else if( IsScrollable() )
nRole = accessibility::AccessibleRole::SCROLL_PANE;
- else if( const_cast<vcl::Window*>(this)->ImplGetWindow()->IsMenuFloatingWindow() )
+ else if( this->ImplGetWindow()->IsMenuFloatingWindow() )
nRole = accessibility::AccessibleRole::WINDOW; // #106002#, contextmenus are windows (i.e. toplevel)
else
// #104051# WINDOW seems to be a bad default role, use LAYEREDPANE instead
@@ -527,7 +527,7 @@ OUString Window::GetAccessibleDescription() const
{
// Special code for help text windows. ZT asks the border window for the
// description so we have to forward this request to our inner window.
- const vcl::Window* pWin = const_cast<vcl::Window *>(this)->ImplGetWindow();
+ const vcl::Window* pWin = this->ImplGetWindow();
if ( pWin->GetType() == WindowType::HELPTEXTWINDOW )
aAccessibleDescription = pWin->GetHelpText();
else
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c61cbc878864..03eee84e4a97 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3898,8 +3898,7 @@ VclBuilder::PackingData VclBuilder::get_window_packing_data(const vcl::Window *p
//border windows placed around them which are what you get
//from GetChild, so scoot up a level if necessary to get the
//window whose position value we have
- const vcl::Window *pPropHolder = pWindow->ImplGetWindowImpl()->mpClientWindow ?
- pWindow->ImplGetWindowImpl()->mpClientWindow : pWindow;
+ const vcl::Window *pPropHolder = pWindow->ImplGetWindow();
for (auto const& child : m_aChildren)
{
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 36dcf861c566..bda29cd62c1a 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -94,9 +94,9 @@ static vcl::Window* ImplGetCurTabWindow(const vcl::Window* pWindow)
static vcl::Window* ImplGetSubChildWindow( vcl::Window* pParent, sal_uInt16 n, sal_uInt16& nIndex )
{
- // ignore border window
- pParent = pParent->ImplGetWindow();
- assert(pParent == pParent->ImplGetWindow());
+ // ignore all windows with mpClientWindow set
+ for (vcl::Window *pNewParent = pParent->ImplGetWindow();
+ pParent != pNewParent; pParent = pNewParent);
vcl::Window* pFoundWindow = nullptr;
vcl::Window* pWindow = firstLogicalChildOfParent(pParent);
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 00ea845972a8..b268f14960e0 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -1078,7 +1078,7 @@ vcl::Window* Window::GetWindow( GetWindowType nType ) const
return mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpOverlapWindow;
case GetWindowType::Client:
- return const_cast<vcl::Window*>(this)->ImplGetWindow();
+ return this->ImplGetWindow();
case GetWindowType::RealParent:
return ImplGetParent();
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index bce47fc40a00..9c75767561ea 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -825,12 +825,12 @@ OString Window::GetScreenshotId() const
// --------- old inline methods ---------------
-vcl::Window* Window::ImplGetWindow()
+vcl::Window* Window::ImplGetWindow() const
{
if ( mpWindowImpl->mpClientWindow )
return mpWindowImpl->mpClientWindow;
else
- return this;
+ return const_cast<vcl::Window*>(this);
}
ImplFrameData* Window::ImplGetFrameData()