diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-04 13:57:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-04 13:57:31 +0100 |
commit | ac8cb745d7b385b24a3576aa6c40780fdcfe9b15 (patch) | |
tree | 0352f7780d27dbeca5237a520cbf8dc1e1ead0d6 | |
parent | a5090ccf756aac2365fd52d7cf9b423f54c5c6f6 (diff) |
Disable "Insert - Duplicate Slide" when no slide is selected
...and the command just did nothing.
Change-Id: Ib39d24c2f4c2b34b887495e3eeef58c0be44af63
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index b0ce46b309be..23eb70583e3a 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -644,15 +644,23 @@ void SlotManager::GetMenuState (SfxItemSet& rSet) // Disable the rename slots when there are no or more than one slides/master - // pages selected. + // pages selected; disable the duplicate slot when there are no slides + // selected: if (rSet.GetItemState(SID_RENAMEPAGE) == SFX_ITEM_AVAILABLE - || rSet.GetItemState(SID_RENAME_MASTER_PAGE) == SFX_ITEM_AVAILABLE) + || rSet.GetItemState(SID_RENAME_MASTER_PAGE) == SFX_ITEM_AVAILABLE + || rSet.GetItemState(SID_DUPLICATE_PAGE) == SFX_ITEM_AVAILABLE) { - if (mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount() != 1) + int n = mrSlideSorter.GetController().GetPageSelector() + .GetSelectedPageCount(); + if (n != 1) { rSet.DisableItem(SID_RENAMEPAGE); rSet.DisableItem(SID_RENAME_MASTER_PAGE); } + if (n == 0) + { + rSet.DisableItem(SID_DUPLICATE_PAGE); + } } if (rSet.GetItemState(SID_HIDE_SLIDE) == SFX_ITEM_AVAILABLE |