diff options
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs | 2 | ||||
-rw-r--r-- | vcl/source/helper/commandinfoprovider.cxx | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs index 54714b6fa088..678bea7545f8 100644 --- a/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/UI/Commands.xcs @@ -43,7 +43,7 @@ </prop> <prop oor:name="TooltipLabel" oor:type="xs:string" oor:localized="true"> <info> - <desc>Used for Tooltips (Toolbar and Glade Widgets that have their 'action_name' specified.)</desc> + <desc>Used for Tooltips (Toolbar and Glade Widgets that have their 'action_name' specified.). Defaults to PopupLabel, then Label if empty.</desc> </info> </prop> <prop oor:name="TargetURL" oor:type="xs:string" oor:localized="false"> diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 7a03c80afa7b..00fa0c8cc093 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -18,6 +18,8 @@ */ #include <vcl/commandinfoprovider.hxx> +#include <vcl/mnemonic.hxx> +#include <comphelper/string.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> @@ -163,8 +165,12 @@ OUString CommandInfoProvider::GetTooltipForCommand ( SetFrame(rxFrame); OUString sLabel (GetCommandProperty("TooltipLabel", rsCommandName)); - if (sLabel.isEmpty()) - sLabel = GetCommandProperty("Name", rsCommandName); + if (sLabel.isEmpty()) { + sLabel = GetPopupLabelForCommand(rsCommandName, rxFrame); + // Remove '...' at the end and mnemonics (we don't want those in tooltips) + sLabel = comphelper::string::stripEnd(sLabel, '.'); + sLabel = MnemonicGenerator::EraseAllMnemonicChars(sLabel); + } // Command can be just an alias to another command, // so need to get the shortcut of the "real" command. |