summaryrefslogtreecommitdiff
path: root/vcl/source/helper
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-17 12:08:30 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-17 12:12:11 +0100
commit81ff7cfddb8e6786529f0a878007e9d399d4908a (patch)
tree3d944085db21ebcfa18c38631d2aaa3556e6c7a1 /vcl/source/helper
parent2e88fbd747ef2fc7e2d266f7f15db37ecab7662d (diff)
tdf#95845 Add methods for menu labels to CommandInfoProvider
Change-Id: Ibf6a26940ec194f540255584776f8ebcefbb94ae
Diffstat (limited to 'vcl/source/helper')
-rw-r--r--vcl/source/helper/commandinfoprovider.cxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index dde74417a14c..6a7e86802956 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -103,7 +103,6 @@ CommandInfoProvider::~CommandInfoProvider()
}
}
-
OUString CommandInfoProvider::GetLabelForCommand (
const OUString& rsCommandName,
const Reference<frame::XFrame>& rxFrame)
@@ -113,6 +112,29 @@ OUString CommandInfoProvider::GetLabelForCommand (
return GetCommandProperty("Name", rsCommandName);
}
+OUString CommandInfoProvider::GetMenuLabelForCommand (
+ const OUString& rsCommandName,
+ const Reference<frame::XFrame>& rxFrame)
+{
+ SetFrame(rxFrame);
+
+ // Here we want to use "Label", not "Name". "Name" is a stripped-down version of "Label" without accelerators
+ // and ellipsis. In the menu, we want to have those accelerators and ellipsis.
+ return GetCommandProperty("Label", rsCommandName);
+}
+
+OUString CommandInfoProvider::GetPopupLabelForCommand (
+ const OUString& rsCommandName,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame)
+{
+ SetFrame(rxFrame);
+
+ OUString sPopupLabel(GetCommandProperty("PopupLabel", rsCommandName));
+ if (!sPopupLabel.isEmpty())
+ return sPopupLabel;
+ return GetCommandProperty("Label", rsCommandName);
+}
+
OUString CommandInfoProvider::GetTooltipForCommand (
const OUString& rsCommandName,
const Reference<frame::XFrame>& rxFrame,
@@ -122,7 +144,7 @@ OUString CommandInfoProvider::GetTooltipForCommand (
OUString sLabel (GetCommandProperty("TooltipLabel", rsCommandName));
if (sLabel.isEmpty())
- sLabel = GetLabelForCommand(rsCommandName, rxFrame);
+ sLabel = GetCommandProperty("Name", rsCommandName);
if (bIncludeShortcut) {
const OUString sShortCut(GetCommandShortcut(rsCommandName, rxFrame));