[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/source

Katarina Behrens Katarina.Behrens at cib.de
Thu Jun 16 08:54:10 UTC 2016


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

New commits:
commit 343f12ca3fdb3503995619a3caa1b15f77c04baa
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>
    (cherry picked from commit 9e28a809d3e9fcd69b07933d698e1e166867b5c8)

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 9c3274e..ff5f84c 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -22,6 +22,7 @@
 #include "TransitionPreset.hxx"
 #include "sdresid.hxx"
 #include "ViewShellBase.hxx"
+#include "FrameView.hxx"
 #include "DrawDocShell.hxx"
 #include "SlideSorterViewShell.hxx"
 #include "drawdoc.hxx"
@@ -163,7 +164,6 @@ void SlideBackground::Initialize()
     mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
     mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
 
-    populateMasterSlideDropdown();
 
     meUnit = maPaperSizeController.GetCoreMetric();
 
@@ -174,13 +174,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);
@@ -296,6 +304,7 @@ void SlideBackground::addListener()
     mrBase.GetEventMultiplexer()->AddEventListener (
         aLink,
         tools::EventMultiplexerEvent::EID_CURRENT_PAGE |
+        tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED |
         tools::EventMultiplexerEvent::EID_SHAPE_CHANGED );
 }
 
@@ -315,6 +324,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