summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-04-08 16:35:57 +0200
committerJan Holesovsky <kendy@collabora.com>2016-04-08 16:45:07 +0200
commitb98f2cc3cf8bd2721ec8118af64edd3424c69dc2 (patch)
treeaee040a26fcd4aa80111f3fdfcfc22067d43885d /sfx2
parent7dda56143f17f9b85bcc9630f2fad12b65541fc2 (diff)
lok context menu: Handle the case we only get the slot-id.
Change-Id: I7a2537ccebf80c79bf61f041bfb18cd6ddc93ca2
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/dispatch.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 15681da2ac11..396f9936ad96 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -176,7 +176,14 @@ namespace {
else
{
const sal_uInt16 nItemId = pMenu->GetItemId(nPos);
- const OUString aCommandURL = pMenu->GetItemCommand(nItemId);
+ OUString aCommandURL = pMenu->GetItemCommand(nItemId);
+
+ if (aCommandURL.isEmpty())
+ {
+ const SfxSlot *pSlot = SFX_SLOTPOOL().GetSlot(nItemId);
+ if (pSlot)
+ aCommandURL = pSlot->GetCommandString();
+ }
const OUString aItemText = pMenu->GetItemText(nItemId);
Menu* pPopupSubmenu = pMenu->GetPopupMenu(nItemId);