Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


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.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.