From bca961b855c638bb6863a663972121d4414c64a7 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Sat, 14 Apr 2012 10:58:32 +0200 Subject: Simplify the construction of the '>>' menu. --- framework/source/uielement/toolbarmanager.cxx | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'framework') diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 4fe4712cca2f..e3e595051d68 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1872,25 +1872,9 @@ IMPL_LINK( ToolBarManager, MenuButton, ToolBox*, pToolBar ) if ( m_bDisposed ) return 1; - PopupMenu * pMenu = GetToolBarCustomMenu(pToolBar); - if (pMenu) - { - 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 ); - } - } + pToolBar->UpdateCustomMenu(); + // remove all entries that do not come from the toolbar itself (fdo#38276) + ImplClearPopupMenu( pToolBar ); return 0; } -- cgit v1.2.3