[Libreoffice-commits] core.git: sfx2/source

Jan Holesovsky kendy at collabora.com
Fri Apr 8 14:45:58 UTC 2016


 sfx2/source/control/dispatch.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit b98f2cc3cf8bd2721ec8118af64edd3424c69dc2
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Apr 8 16:35:57 2016 +0200

    lok context menu: Handle the case we only get the slot-id.
    
    Change-Id: I7a2537ccebf80c79bf61f041bfb18cd6ddc93ca2

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 15681da..396f993 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);


More information about the Libreoffice-commits mailing list