[Libreoffice-commits] core.git: sd/source

Stephan Bergmann sbergman at redhat.com
Tue Feb 4 04:57:52 PST 2014


 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit ac8cb745d7b385b24a3576aa6c40780fdcfe9b15
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Feb 4 13:57:11 2014 +0100

    Disable "Insert - Duplicate Slide" when no slide is selected
    
    ...and the command just did nothing.
    
    Change-Id: Ib39d24c2f4c2b34b887495e3eeef58c0be44af63

diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index b0ce46b..23eb705 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


More information about the Libreoffice-commits mailing list