summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-25 20:37:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:52 +0100
commitdc5d6deb158bf4506630a4ef006b4eaeb9998fbf (patch)
treea270696256fb25757612d7b0062ee9da351fd67c /vcl/source/window
parent5d60e826ae6b10161ecff64fbfbf9af230898764 (diff)
we need to have the outermost TabDialog as the recipient of tab keystrokes
Change-Id: I1d230512d2145a9a3198c25c60dcd8954928120e
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/dlgctrl.cxx13
-rw-r--r--vcl/source/window/layout.cxx17
-rw-r--r--vcl/source/window/window.cxx3
3 files changed, 22 insertions, 11 deletions
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 20027768eca1..8a47e5992cee 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -52,8 +52,9 @@ static sal_Bool ImplHasIndirectTabParent( Window* pWindow )
// The window has inderect tab parent if it is included in tab hierarchy
// of the indirect parent window
- return ( pWindow && pWindow->GetParent()
- && ( pWindow->GetParent()->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) );
+ Window* pNonLayoutParent = getNonLayoutParent(pWindow);
+ return ( pNonLayoutParent
+ && ( pNonLayoutParent->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) );
}
// -----------------------------------------------------------------------
@@ -68,8 +69,12 @@ static Window* ImplGetTopParentOfTabHierarchy( Window* pParent )
if ( pResult )
{
- while ( pResult->GetParent() && ( pResult->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) )
- pResult = pResult->GetParent();
+ Window* pNonLayoutParent = getNonLayoutParent(pResult);
+ while ( pNonLayoutParent && ( pResult->ImplGetWindow()->GetStyle() & WB_CHILDDLGCTRL ) )
+ {
+ pResult = pNonLayoutParent;
+ pNonLayoutParent = getNonLayoutParent(pResult);
+ }
}
return pResult;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 9ab95793f706..8666ef5874b7 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1072,13 +1072,18 @@ Size getLegacyBestSizeForChildren(const Window &rWindow)
return aRet;
}
-Window* getLegacyNonLayoutParent(Window *pParent)
+Window* getNonLayoutParent(Window *pWindow)
{
- while (pParent && pParent->GetType() == WINDOW_CONTAINER)
- {
- pParent = pParent->GetParent();
- }
- return pParent;
+ while (pWindow && pWindow->GetType() == WINDOW_CONTAINER)
+ pWindow = pWindow->GetParent();
+ return pWindow;
+}
+
+Window* getNonLayoutRealParent(Window *pWindow)
+{
+ while (pWindow && pWindow->GetType() == WINDOW_CONTAINER)
+ pWindow = pWindow->ImplGetParent();
+ return pWindow;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index d7e362d0c8aa..88df1b407c2a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -35,6 +35,7 @@
#include "unotools/fontcfg.hxx"
#include "unotools/confignode.hxx"
+#include "vcl/layout.hxx"
#include "vcl/unohelp.hxx"
#include "vcl/salgtype.hxx"
#include "vcl/event.hxx"
@@ -5218,7 +5219,7 @@ long Window::Notify( NotifyEvent& rNEvt )
if ( (rNEvt.GetType() == EVENT_KEYINPUT) || (rNEvt.GetType() == EVENT_KEYUP) )
{
if ( ImplIsOverlapWindow() ||
- ((ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
+ ((getNonLayoutRealParent(this)->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) )
{
nRet = ImplDlgCtrl( *rNEvt.GetKeyEvent(), rNEvt.GetType() == EVENT_KEYINPUT );
}