diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-26 00:11:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:52 +0100 |
commit | 595feb2f04993ec85315af2862bc764a5fef9163 (patch) | |
tree | 8f3301755ff9139b7ce8d3fc082f78c0bc25c4dc | |
parent | dc5d6deb158bf4506630a4ef006b4eaeb9998fbf (diff) |
fix getNonLayout[Real]Parent helpers
Change-Id: Idae11802aaeb3d9192cdf7fe8fae61788bbb9b5b
-rw-r--r-- | vcl/source/window/layout.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 8666ef5874b7..2fa259ba9003 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1074,15 +1074,23 @@ Size getLegacyBestSizeForChildren(const Window &rWindow) Window* getNonLayoutParent(Window *pWindow) { - while (pWindow && pWindow->GetType() == WINDOW_CONTAINER) + while (pWindow) + { pWindow = pWindow->GetParent(); + if (!pWindow || pWindow->GetType() != WINDOW_CONTAINER) + break; + } return pWindow; } Window* getNonLayoutRealParent(Window *pWindow) { - while (pWindow && pWindow->GetType() == WINDOW_CONTAINER) + while (pWindow) + { pWindow = pWindow->ImplGetParent(); + if (!pWindow || pWindow->GetType() != WINDOW_CONTAINER) + break; + } return pWindow; } |