diff options
-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; } |