diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-09-25 18:15:27 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-09-25 18:48:12 +0300 |
commit | 02ddfd10e9e46e2b121416d815303c386400ba6f (patch) | |
tree | 80e808a7592f77c7c6c7e29036b266744983268b /vcl | |
parent | f3fd652f396219a462060342f1e135afcfad5417 (diff) |
tdf#96736 Let MenuBarManager handle the save dropdown
Instead of trying to do everything (icon theme
changes, disabling commands etc.) manually.
Change-Id: Iffd420bf09ccd566e96f39cb9684ab466a7c6555
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/menu.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 579e993e14a1..a93811d623b7 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -515,15 +515,21 @@ void Menu::InsertItem( const ResId& rResId ) void Menu::InsertItem(const OUString& rCommand, const css::uno::Reference<css::frame::XFrame>& rFrame) { - OUString aLabel(CommandInfoProvider::Instance().GetPopupLabelForCommand(rCommand, rFrame)); - OUString aTooltip(CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame)); - Image aImage(CommandInfoProvider::Instance().GetImageForCommand(rCommand, /*bLarge=*/ false, rFrame)); - sal_uInt16 nItemId = GetItemCount() + 1; - InsertItem(nItemId, aLabel, aImage); + if (rFrame.is()) + { + OUString aLabel(CommandInfoProvider::Instance().GetPopupLabelForCommand(rCommand, rFrame)); + OUString aTooltip(CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame)); + Image aImage(CommandInfoProvider::Instance().GetImageForCommand(rCommand, /*bLarge=*/ false, rFrame)); + + InsertItem(nItemId, aLabel, aImage); + SetHelpText(nItemId, aTooltip); + } + else + InsertItem(nItemId, OUString()); + SetItemCommand(nItemId, rCommand); - SetHelpText(nItemId, aTooltip); } |