Hi everyone,

I'm new to this list. I've made a simple fix for Bug
38276<https://bugs.freedesktop.org/show_bug.cgi?id=38276> .
The diff is below if anyone wants to have a look (I wasn't sure if I should
add it as an attachment or not?). Bear in mind that I'm completely new to
LibreOffice development and open source development in general.

diff --git a/framework/source/uielement/toolbarmanager.cxx
b/framework/source/uielement/toolbarmanager.cxx
index 80adbd7..ecce13f 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1817,6 +1817,22 @@ PopupMenu *
ToolBarManager::GetToolBarCustomMenu(ToolBox* pToolBar)
             aPopupMenu.RemoveItem( nPos );
     }

+    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 = aPopupMenu.GetItemPos( obsoleteItems[i] );
+        if ( positionInMenu != MENU_ITEM_NOTFOUND )
+            aPopupMenu.RemoveItem( positionInMenu );
+    }
+
     // copy all menu items to the toolbar menu
     if( pMenu->GetItemCount() )
         pMenu->InsertSeparator();

Thanks,

Iain.
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to