Simplify the construction of the '>>' menu.

This commit is contained in:
Jan Holesovsky 2012-04-14 10:58:32 +02:00
parent 3bdb228895
commit bca961b855

View file

@ -1872,25 +1872,9 @@ IMPL_LINK( ToolBarManager, MenuButton, ToolBox*, pToolBar )
if ( m_bDisposed ) if ( m_bDisposed )
return 1; return 1;
PopupMenu * pMenu = GetToolBarCustomMenu(pToolBar); pToolBar->UpdateCustomMenu();
if (pMenu) // remove all entries that do not come from the toolbar itself (fdo#38276)
{ ImplClearPopupMenu( pToolBar );
sal_uInt16 nObsoleteItems = 6;
sal_uInt16 positionInMenu;
sal_uInt32 obsoleteItems[] = { MENUITEM_TOOLBAR_CLOSE ,
MENUITEM_TOOLBAR_VISIBLEBUTTON ,
MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR,
MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION,
MENUITEM_TOOLBAR_DOCKTOOLBAR,
MENUITEM_TOOLBAR_DOCKALLTOOLBAR
};
for( int i = 0 ; i < nObsoleteItems ; i++ )
{
positionInMenu = pMenu->GetItemPos( obsoleteItems[i] );
if ( positionInMenu != MENU_ITEM_NOTFOUND )
pMenu->RemoveItem( positionInMenu );
}
}
return 0; return 0;
} }