summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-10-01 12:19:12 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2018-10-02 21:01:27 +0200
commit408dbdd28037917986f6d2cdc290f935ffefc60e (patch)
tree1721fb4e77cd3d1c1e0c98bd0ac6cec02eb2846d /vcl
parent4e1b526f35abe6a0a01edaa72f9134cb878d4945 (diff)
tdf#120234 ignore all proxy windows
I thought just border windows can act as proxies, but this bug proves me wrong; also floating windows set mpClientWindow and may have an additional nested proxy border window. Interestingly proxies can have multiple children, which I tested with a temporary assertion I added!? So just ignore all proxy windows until we find a real one, And drop the assertion as it doesn't make sense any more. I'm just wondering why I always read Child instead of Client... Change-Id: I83a1a5743b434399aae361cb14058993ba60c83c Reviewed-on: https://gerrit.libreoffice.org/61196 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-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
5 files changed, 9 insertions, 10 deletions
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()