summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-07-13 15:52:26 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-07-13 14:28:48 +0000
commit80f9ad9011843dbc9d166147402366438bcfe29a (patch)
tree2270a1232bfa7118192fa418919758e46446c306 /vcl
parent8c4dbcef8f92c9bd1c2208e7de7971f184f8a3ff (diff)
Make TooltipLabel default to PopupLabel
Because we often have similiar tooltip and menu names. Change-Id: I0ab66269b0b1f2985f23cf92289b3da69b6ddfd3 Reviewed-on: https://gerrit.libreoffice.org/27186 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/helper/commandinfoprovider.cxx10
1 files changed, 8 insertions, 2 deletions
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.