summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-19 13:37:22 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2015-11-19 13:39:17 +0100
commita3eec8a043eae4417276938968a5a8e227d23111 (patch)
tree9ce7c150832d0ca0a97ec0c34556cae52c65e939 /vcl/source/window
parent928fb2c711c10b372dc5b4fb3703a2fa5c40ac03 (diff)
Toolbar: Add 'Save As' to 'Save' dropdown
Change-Id: I6597ae5569b29d09a8c44fc9a55b71166aa37b05
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/menu.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 7c36353f5a4e..803c8a456a1a 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -41,6 +41,7 @@
#include <vcl/toolbox.hxx>
#include <vcl/dockingarea.hxx>
#include <vcl/settings.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <salinst.hxx>
#include <svdata.hxx>
@@ -525,6 +526,23 @@ void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos )
delete mpLayoutData, mpLayoutData = nullptr;
}
+void Menu::InsertItem(const OUString& rCommand, const uno::Reference<frame::XFrame>& rFrame,
+ MenuItemBits nBits, const OString &rIdent, sal_uInt16 nPos)
+{
+ OUString aLabel(CommandInfoProvider::Instance().GetPopupLabelForCommand(rCommand, rFrame));
+ OUString aTooltip(CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame));
+ Image aImage(CommandInfoProvider::Instance().GetImageForCommand(rCommand, /*bLarge=*/ false, rFrame));
+
+ // let's invent an ItemId
+ const sal_uInt16 COMMAND_ITEMID_START = 30000;
+ sal_uInt16 nItemId = COMMAND_ITEMID_START + GetItemCount();
+
+ InsertItem(nItemId, aLabel, aImage, nBits, rIdent, nPos);
+ SetItemCommand(nItemId, rCommand);
+ SetHelpText(nItemId, aTooltip);
+}
+
+
void Menu::InsertSeparator(const OString &rIdent, sal_uInt16 nPos)
{
// do nothing if it's a menu bar