diff options
author | Jan Holesovsky <kendy@suse.cz> | 2012-06-26 13:32:24 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-06-26 14:58:54 +0200 |
commit | e09b973aa21fcdc85edf94ce17a94559ccfadceb (patch) | |
tree | eaf33c81ade624063048548a05ecc7595c402ca7 /vcl | |
parent | 037ddf9c77b5cd50ab41d656222f4d43597b22cc (diff) |
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
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
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; |