summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-03-21 12:05:30 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2016-03-21 12:38:25 +0200
commite4765bdfecf94287aeaf3f27cca185b533761784 (patch)
treebfb334b8986c401519622dc0d40daa4c2b93b02e /vcl
parentf5a53794e188c8ee49173749578a6b81b52a82f4 (diff)
Need to get the shortcut of the real command
... as command alias can't have one by itself. That's the same we do for menus. Change-Id: I555a41282001300fa9aa0e585c073656789c4ebd
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/helper/commandinfoprovider.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index c878a94323bc..77d5ba6903de 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -166,7 +166,10 @@ OUString CommandInfoProvider::GetTooltipForCommand (
if (sLabel.isEmpty())
sLabel = GetCommandProperty("Name", rsCommandName);
- const OUString sShortCut(GetCommandShortcut(rsCommandName, rxFrame));
+ // Command can be just an alias to another command,
+ // so need to get the shortcut of the "real" command.
+ const OUString sRealCommand(GetRealCommandForCommand(rsCommandName, rxFrame));
+ const OUString sShortCut(GetCommandShortcut(!sRealCommand.isEmpty() ? sRealCommand : rsCommandName, rxFrame));
if (!sShortCut.isEmpty())
return sLabel + " (" + sShortCut + ")";
return sLabel;