summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-05-17 17:48:43 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-05-18 00:27:04 +0300
commit598d033c1f345b0f84e43ec7ff2b21fe8c4ce062 (patch)
tree1b52f4dfa050fee83d14aee629e390231466a9af /framework
parent3a72afd05536b291be1a2e8bce5694fe632407d1 (diff)
Fix AddonMenu icon
Another victim of tdf#96059. CommandInfoProvider can only handle .uno:Something, not slot:12345. Also, given that we're using the .uno command name, we can just get the label from officecfg, dropping the local framework string resource. Change-Id: Ia0c32bacb67699311f6bbbec0f350321802f75a0
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/classes/resource.hrc1
-rw-r--r--framework/source/classes/resource.src5
-rw-r--r--framework/source/uielement/menubarmanager.cxx40
3 files changed, 9 insertions, 37 deletions
diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc
index 4c66725c370f..72a45931b048 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -24,7 +24,6 @@
#define RID_MENU_START 10000
#define RID_IMAGE_START 15000
-#define STR_MENU_ADDONS (RID_STR_START+0)
#define STR_MENU_HEADFOOTALL (RID_STR_START+2)
#define STR_UPDATEDOC (RID_STR_START+3)
#define STR_CLOSEDOC_ANDRETURN (RID_STR_START+4)
diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src
index 7cec9dc7b914..62e7b616b6ff 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -19,11 +19,6 @@
#include <classes/resource.hrc>
-String STR_MENU_ADDONS
-{
- Text [ en-US ] = "Add-Ons" ;
-};
-
String STR_MENU_HEADFOOTALL
{
Text [ en-US ] = "All" ;
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 62aba551fcad..895a5392a80b 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -1232,45 +1232,23 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
if ( pPopup->GetItemType( nCount-1 ) != MenuItemType::SEPARATOR )
pPopup->InsertSeparator();
- // Use resource to load popup menu title
- OUString aAddonsStrRes(FwkResId(STR_MENU_ADDONS));
- pPopup->InsertItem( ITEMID_ADDONLIST, aAddonsStrRes );
+ pPopup->InsertItem( ITEMID_ADDONLIST, OUString() );
pPopup->SetPopupMenu( ITEMID_ADDONLIST, pSubMenu );
-
- // Set item command for popup menu to enable it for GetImageFromURL
- OUString aNewItemCommand = "slot:" + OUString::number( ITEMID_ADDONLIST );
- pPopup->SetItemCommand( ITEMID_ADDONLIST, aNewItemCommand );
+ pPopup->SetItemCommand( ITEMID_ADDONLIST, ".uno:Addons" );
}
else
pSubMenu.disposeAndClear();
}
+ MenuBarManager* pSubMenuManager;
if ( nItemId == ITEMID_ADDONLIST )
- {
- AddonMenu* pSubMenu = dynamic_cast< AddonMenu* >( pPopup.get() );
- if ( pSubMenu )
- {
- MenuBarManager* pSubMenuManager = new MenuBarManager( m_xContext, m_xFrame,
- m_xURLTransformer,pSubMenu, false );
- AddMenu(pSubMenuManager,aItemCommand,nItemId);
- (pSubMenuManager->m_aMenuItemCommand).clear();
-
- // Set image for the addon popup menu item
- if ( bItemShowMenuImages && !pPopup->GetItemImage( ITEMID_ADDONLIST ))
- {
- Image aImage = vcl::CommandInfoProvider::GetImageForCommand(aItemCommand, rFrame);
- if ( !!aImage )
- pPopup->SetItemImage( ITEMID_ADDONLIST, aImage );
- }
- }
- }
+ pSubMenuManager = new MenuBarManager( m_xContext, m_xFrame, m_xURLTransformer, pPopup, false );
else
- {
- MenuBarManager* pSubMenuMgr = new MenuBarManager( m_xContext, rFrame, m_xURLTransformer,
- rDispatchProvider, aModuleIdentifier,
- pPopup, false, m_bHasMenuBar );
- AddMenu(pSubMenuMgr,aItemCommand,nItemId);
- }
+ pSubMenuManager = new MenuBarManager( m_xContext, rFrame, m_xURLTransformer,
+ rDispatchProvider, aModuleIdentifier,
+ pPopup, false, m_bHasMenuBar );
+
+ AddMenu(pSubMenuManager, aItemCommand, nItemId);
}
}
else if ( pMenu->GetItemType( i ) != MenuItemType::SEPARATOR )