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

Katarina Behrens Katarina.Behrens at cib.de
Wed Jun 15 22:06:24 UTC 2016


 sd/source/ui/sidebar/SlideBackground.cxx |   37 +++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 7 deletions(-)

New commits:
commit 9e28a809d3e9fcd69b07933d698e1e166867b5c8
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Tue Jun 14 22:54:37 2016 +0200

    tdf#100209: Master slide of master slide makes no sense
    
    so just disable the controls when in master view
    
    Change-Id: I9551cc5c0d123e58555d248b78859c1f77de6690
    Reviewed-on: https://gerrit.libreoffice.org/26276
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 24068ac..3ca1d7d 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -24,6 +24,7 @@
 #include "TransitionPreset.hxx"
 #include "sdresid.hxx"
 #include "ViewShellBase.hxx"
+#include "FrameView.hxx"
 #include "DrawDocShell.hxx"
 #include "SlideSorterViewShell.hxx"
 #include "drawdoc.hxx"
@@ -119,7 +120,6 @@ void SlideBackground::Initialize()
     mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
     mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
 
-    populateMasterSlideDropdown();
 
     meUnit = maPaperSizeController.GetCoreMetric();
 
@@ -130,13 +130,21 @@ void SlideBackground::Initialize()
     mpFillGrad->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl));
     mpFillAttr->SetSelectHdl(LINK(this, SlideBackground, FillBackgroundHdl));
 
-    if (ViewShell* pMainViewShell = mrBase.GetMainViewShell().get())
+    ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
+    if (pMainViewShell)
     {
-        DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
-        SdPage* mpPage = pDrawViewShell->getCurrentPage();
-        OUString aLayoutName( mpPage->GetLayoutName() );
-        aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR));
-        mpMasterSlide->SelectEntry(aLayoutName);
+        FrameView *pFrameView = pMainViewShell->GetFrameView();
+
+        if ( pFrameView->GetViewShEditMode() ==  EM_PAGE )
+        {
+            DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
+            SdPage* mpPage = pDrawViewShell->getCurrentPage();
+            populateMasterSlideDropdown();
+
+            OUString aLayoutName( mpPage->GetLayoutName() );
+            aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR));
+            mpMasterSlide->SelectEntry(aLayoutName);
+        }
     }
 
     mpFillStyle->SelectEntryPos(0);
@@ -278,6 +286,7 @@ void SlideBackground::addListener()
     mrBase.GetEventMultiplexer()->AddEventListener (
         aLink,
         tools::EventMultiplexerEvent::EID_CURRENT_PAGE |
+        tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED |
         tools::EventMultiplexerEvent::EID_SHAPE_CHANGED );
 }
 
@@ -297,6 +306,20 @@ IMPL_LINK_TYPED(SlideBackground, EventMultiplexerListener,
         case tools::EventMultiplexerEvent::EID_SHAPE_CHANGED:
             populateMasterSlideDropdown();
             break;
+        case tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
+        {
+            ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
+
+            if (pMainViewShell)
+            {
+                DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
+                EditMode eMode = pDrawViewShell->GetEditMode();
+
+                if ( eMode == EM_MASTERPAGE)
+                    mpMasterSlide->Disable();
+            }
+        }
+        break;
         case tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
         {
             static sal_uInt16 SidArray[] = {


More information about the Libreoffice-commits mailing list