[Libreoffice-commits] .: Branch 'libreoffice-3-6' - vcl/source

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Jun 26 05:59:50 PDT 2012


 vcl/source/window/menu.cxx |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 76ec145c75790b8c6407959fda962626c1b963dc
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Jun 26 13:32:24 2012 +0200

    Fix more bugs in ImplgetTopDockingAreaHeight().
    
    - fixed infinite loop (calling next in an 'else' is a bad idea)
    - there may be more top docking areas, pick the one with != 0 height
    
    Change-Id: I4892a655e25efff4d7282c5106ba238f94586374

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 0fff3c3..3b4ac0d 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -875,15 +875,18 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow )
                     if ( pChildWin->GetType() == WINDOW_DOCKINGAREA )
                         pDockingArea = static_cast< DockingAreaWindow* >( pChildWin );
 
-                    if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP && pDockingArea->IsVisible() )
+                    if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP &&
+                        pDockingArea->IsVisible() && pDockingArea->GetOutputSizePixel().Height() != 0 )
+                    {
                         return pDockingArea->GetOutputSizePixel().Height();
-                    else
-                        pChildWin = pChildWin->GetWindow( WINDOW_NEXT ); //mpWindowImpl->mpNext;
+                    }
+
+                    pChildWin = pChildWin->GetWindow( WINDOW_NEXT ); //mpWindowImpl->mpNext;
                 }
 
             }
-            else
-                pWin = pWin->GetWindow( WINDOW_NEXT ); //mpWindowImpl->mpNext;
+
+            pWin = pWin->GetWindow( WINDOW_NEXT ); //mpWindowImpl->mpNext;
         }
     }
     return 0;


More information about the Libreoffice-commits mailing list