From b640c63086495a6216ad2a63f2219380cbfb5dff Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 3 Jun 2012 21:02:37 +0100 Subject: at one stage we had checkmarks *and* icons in menus side by side later on we ended up with toggleable icons instead, change comment to reflect the current situation Change-Id: Ia39f6bffe8e5942442482b1f845d2964138ec032 --- vcl/source/window/menu.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 2987267527d0..2779b373a17b 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2348,19 +2348,14 @@ void Menu::ImplRemoveDel( ImplMenuDelData& rDel ) Size Menu::ImplCalcSize( Window* pWin ) { - // | Checked| Image| Text| Accel/Popup| + // | Check/Radio/Image| Text| Accel/Popup| // for symbols: nFontHeight x nFontHeight long nFontHeight = pWin->GetTextHeight(); long nExtra = nFontHeight/4; - - Size aSz; - Size aMaxImgSz; - long nMaxWidth = 0; long nMinMenuItemHeight = nFontHeight; long nCheckHeight = 0, nRadioHeight = 0; - long nCheckWidth = 0; Size aMaxSize = ImplGetNativeCheckAndRadioSize(pWin, nCheckHeight, nRadioHeight); if( aMaxSize.Height() > nMinMenuItemHeight ) nMinMenuItemHeight = aMaxSize.Height(); @@ -2369,6 +2364,8 @@ Size Menu::ImplCalcSize( Window* pWin ) // have to add some extra space even in the MENU_FLAG_SHOWCHECKIMAGES case bool bSpaceForCheckbox = ( aMaxSize.Height() == 0 ); + Size aMaxImgSz; + const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings(); if ( rSettings.GetUseImagesInMenus() ) { @@ -2395,6 +2392,10 @@ Size Menu::ImplCalcSize( Window* pWin ) } } + Size aSz; + long nCheckWidth = 0; + long nMaxWidth = 0; + for ( size_t n = pItemList->size(); n; ) { MenuItemData* pData = pItemList->GetDataFromPos( --n ); -- cgit v1.2.3