summaryrefslogtreecommitdiff
path: root/sfx2/source/menu
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-07-10 18:21:24 +0200
committerMathias Bauer <mba@openoffice.org>2010-07-10 18:21:24 +0200
commitf24b1da07ebfbc95e76af93fc9c7133f7d52daa5 (patch)
tree1d666fcdca0e60613c321b05a1371ab53fdb6e88 /sfx2/source/menu
parentf8a801d058e39e89a71c85afdb0b1c1718f36b45 (diff)
CWS changehid: #i111874#: change code to support HelpIds as byte strings
Diffstat (limited to 'sfx2/source/menu')
-rw-r--r--sfx2/source/menu/menu.src7
-rw-r--r--sfx2/source/menu/mnumgr.cxx7
-rw-r--r--sfx2/source/menu/virtmenu.cxx26
3 files changed, 15 insertions, 25 deletions
diff --git a/sfx2/source/menu/menu.src b/sfx2/source/menu/menu.src
index 97c9c7f640fa..0f9501e8502a 100644
--- a/sfx2/source/menu/menu.src
+++ b/sfx2/source/menu/menu.src
@@ -26,6 +26,7 @@
************************************************************************/
#include "menu.hrc"
+#include <sfx2/sfxcommands.h>
String STR_MENU_CFGITEM
{
@@ -44,19 +45,19 @@ Menu MN_CLIPBOARDFUNCS
MenuItem
{
Identifier = SID_CUT ;
- HelpID = SID_CUT ;
+ HelpID = CMD_SID_CUT ;
Text [ en-US ] = "Cu~t" ;
};
MenuItem
{
Identifier = SID_COPY ;
- HelpID = SID_COPY ;
+ HelpID = CMD_SID_COPY ;
Text [ en-US ] = "~Copy" ;
};
MenuItem
{
Identifier = SID_PASTE ;
- HelpID = SID_PASTE ;
+ HelpID = CMD_SID_PASTE ;
Text [ en-US ] = "~Paste" ;
};
};
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index 9137abd04764..c76f47345979 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -160,8 +160,6 @@ void InsertVerbs_Impl( SfxBindings* pBindings, const com::sun::star::uno::Sequen
// einf"ugen
pMenu->InsertItem( nId, aVerbs[n].VerbName );
- // FIXME: HELPID
- pMenu->SetHelpId( nId, ""/*(ULONG) nId*/ );
}
}
}
@@ -376,11 +374,10 @@ void SfxPopupMenuManager::InsertSeparator( USHORT nPos )
//-------------------------------------------------------------------------
-void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, USHORT nPos )
+void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, const rtl::OString& rHelpId, USHORT nPos )
{
pSVMenu->InsertItem( nId, rName, nBits,nPos );
- // FIXME: HELPID
- pSVMenu->SetHelpId( nId, ""/*(ULONG) nId*/ );
+ pSVMenu->SetHelpId( nId, rHelpId );
}
//-------------------------------------------------------------------------
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index e3d694eae747..48ff6a3948c5 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -345,7 +345,9 @@ void SfxVirtualMenu::CreateFromSVMenu()
DBG_CHKTHIS(SfxVirtualMenu, 0);
// Merge Addon popup menus into the SV Menu
- Reference< com::sun::star::frame::XFrame > xFrame( pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface() );
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame();
+ SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool();
+ Reference< com::sun::star::frame::XFrame > xFrame( pViewFrame->GetFrame().GetFrameInterface() );
if ( pSVMenu->IsMenuBar() )
{
@@ -448,24 +450,14 @@ void SfxVirtualMenu::CreateFromSVMenu()
}
else
{
-/*
- if ( nSlotId >= SID_SFX_START && !SfxMenuManager::IsPopupFunction(nSlotId) )
+ const SfxSlot* pSlot = pSlotPool->GetSlot( nSlotId );
+ if ( pSlot )
{
- // Echte Popups sollen keine SlotIds haben; leider sind
- // da noch Altlasten mit herumzuschleppen ...
- String aTitle = pSVMenu->GetItemText( nSlotId );
- pSVMenu->SetPopupMenu( nSlotId, NULL );
- USHORT nPos = pSVMenu->GetItemPos( nSlotId );
- pSVMenu->RemoveItem( nPos );
- nSlotId = 1;
- while ( pSVMenu->GetItemPos(nSlotId) != MENU_ITEM_NOTFOUND )
- nSlotId++;
- pSVMenu->InsertItem( nSlotId, aTitle, 0, nPos );
- pSVMenu->SetPopupMenu( nSlotId, pPopup );
+ rtl::OString aCmd(".uno:");
+ aCmd += pSlot->GetUnoName();
+ pSVMenu->SetHelpId( nSlotId, pSlot->GetUnoName() );
}
-*/
- // FIXME: HELPID
- pSVMenu->SetHelpId( nSlotId, ""/*0L*/ );
+
pMnuCtrl = pItems+nPos;
// normalerweise jetzt erst im Activate-Handler