Update ooo320-m1
[ooovba.git] / applied_patches / 0065-vcl-menu-fixes.diff
blob319efbcc64c0f847c554127ff034930c28ff2ba4
1 --- vcl/source/window/menu.cxx 19 Jul 2006 14:59:50 -0000 1.139
2 +++ vcl/source/window/menu.cxx 31 Jul 2006 15:20:05 -0000
3 @@ -957,7 +957,7 @@ void Menu::ImplInit()
5 mnHighlightedItemPos = ITEMPOS_INVALID;
6 mpSalMenu = NULL;
7 - nMenuFlags = MENU_FLAG_SHOWCHECKIMAGES;
8 + nMenuFlags = 0;
9 nDefaultItem = 0;
10 //bIsMenuBar = FALSE; // this is now set in the ctor, must not be changed here!!!
11 nSelectedId = 0;
12 @@ -2278,6 +2277,10 @@ Size Menu::ImplCalcSize( Window* pWin )
13 if( nMax > nMinMenuItemHeight )
14 nMinMenuItemHeight = nMax;
16 + // When no native rendering of the checkbox & no image in the menu, we
17 + // have to add some extra space even in the MENU_FLAG_SHOWCHECKIMAGES case
18 + bool bSpaceForCheckbox = ( nMax == 0 );
20 const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings();
21 if ( rSettings.GetUseImagesInMenus() )
23 @@ -2287,6 +2290,9 @@ Size Menu::ImplCalcSize( Window* pWin )
24 MenuItemData* pData = pItemList->GetDataFromPos( --i );
25 if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE )))
27 + // we have an icon, don't add the extra space
28 + bSpaceForCheckbox = false;
30 Size aImgSz = pData->aImage.GetSizePixel();
31 if ( aImgSz.Height() > aMaxImgSz.Height() )
32 aMaxImgSz.Height() = aImgSz.Height();
33 @@ -2331,7 +2337,7 @@ Size Menu::ImplCalcSize( Window* pWin )
34 if ( !bIsMenuBar && pData->HasCheck() )
36 nCheckWidth = nMaxCheckWidth;
37 - if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
38 + if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox )
40 // checks / images take the same place
41 if( ! ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) )
42 @@ -2391,7 +2397,7 @@ Size Menu::ImplCalcSize( Window* pWin )
44 USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
45 nCheckPos = (USHORT)nExtra;
46 - if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
47 + if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox )
49 long nImgOrChkWidth = 0;
50 nImagePos = nCheckPos;