[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 25 16:12:13 PDT 2012


 vcl/source/window/layout.cxx |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 8f30d9a19ad4a49be59b5da1fad0e9d7efcbed24
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Sep 26 00:11:12 2012 +0100

    fix getNonLayout[Real]Parent helpers
    
    Change-Id: Idae11802aaeb3d9192cdf7fe8fae61788bbb9b5b

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 8666ef5..2fa259b 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;
 }
 


More information about the Libreoffice-commits mailing list