From 595feb2f04993ec85315af2862bc764a5fef9163 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 26 Sep 2012 00:11:12 +0100 Subject: fix getNonLayout[Real]Parent helpers Change-Id: Idae11802aaeb3d9192cdf7fe8fae61788bbb9b5b --- vcl/source/window/layout.cxx | 12 ++++++++++-- 1 file 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; } -- cgit v1.2.3