From e09b973aa21fcdc85edf94ce17a94559ccfadceb Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 26 Jun 2012 13:32:24 +0200 Subject: 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 --- vcl/source/window/menu.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'vcl/source') diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 0fff3c32daf0..3b4ac0d693e2 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; -- cgit