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

Tamás Zolnai tamas.zolnai at collabora.com
Sat Nov 11 21:05:59 UTC 2017


 sd/source/ui/sidebar/SlideBackground.cxx |   48 ++++++++++++++++++++++++-------
 sd/source/ui/sidebar/SlideBackground.hxx |    1 
 2 files changed, 39 insertions(+), 10 deletions(-)

New commits:
commit 4c656c82ccdaa47cf447dfff4147b339b44ea8c1
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Sat Nov 11 19:10:01 2017 +0100

    tdf#111835: Hide Master slide / close master slide button in notes view
    
    These buttons are designed for normal and master slide view.
    
    Change-Id: Ifc093a1da7e2336a1a83332e893dbc619519aaba
    Reviewed-on: https://gerrit.libreoffice.org/44635
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 6ce4eaa39d13..72954fcf6582 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -121,6 +121,7 @@ SlideBackground::SlideBackground(
     maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage),
     maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage),
     maImpressHandoutContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::HandoutPage),
+    maImpressNotesContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::NotesPage),
     mbTitle(false),
     mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) ),
     mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) ),
@@ -182,7 +183,8 @@ bool SlideBackground::IsImpress()
 {
     return ( maContext == maImpressMasterContext ||
              maContext == maImpressOtherContext ||
-             maContext == maImpressHandoutContext );
+             maContext == maImpressHandoutContext ||
+             maContext == maImpressNotesContext );
 }
 
 void SlideBackground::Initialize()
@@ -253,16 +255,16 @@ void SlideBackground::HandleContextChange(
         }
         else if ( maContext == maImpressHandoutContext )
         {
+            mpCloseMaster->Hide();
+            mpEditMaster->Hide();
+            mpMasterSlide->Disable();
+            mpDspMasterBackground->Disable();
+            mpDspMasterObjects->Disable();
             mpFillStyle->Hide();
-            mpFillLB->Hide();
-            mpFillAttr->Hide();
-            mpFillGrad->Hide();
             mpBackgroundLabel->Hide();
             mpInsertImage->Hide();
-            mpEditMaster->Hide();
-            mpCloseMaster->Hide();
         }
-        else if (maContext == maImpressOtherContext )
+        else if (maContext == maImpressOtherContext)
         {
             mpCloseMaster->Hide();
             mpEditMaster->Show();
@@ -273,6 +275,17 @@ void SlideBackground::HandleContextChange(
             mpBackgroundLabel->Show();
             mpInsertImage->Show();
         }
+        else if (maContext == maImpressNotesContext)
+        {
+            mpCloseMaster->Hide();
+            mpEditMaster->Hide();
+            mpMasterSlide->Disable();
+            mpDspMasterBackground->Disable();
+            mpDspMasterObjects->Disable();
+            mpFillStyle->Show();
+            mpBackgroundLabel->Show();
+            mpInsertImage->Hide();
+        }
         // Need to do a relayouting, otherwise the panel size is not updated after show / hide controls
         sfx2::sidebar::Panel* pPanel = dynamic_cast<sfx2::sidebar::Panel*>(GetParent());
         if(pPanel)
@@ -286,7 +299,10 @@ void SlideBackground::HandleContextChange(
 
 void SlideBackground::Update()
 {
-    const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectedEntryPos();
+    eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectedEntryPos();
+
+    if(maContext == maImpressHandoutContext)
+        nPos = NONE;
 
     SfxObjectShell* pSh = SfxObjectShell::Current();
     if (!pSh)
@@ -305,8 +321,6 @@ void SlideBackground::Update()
         {
             mpFillAttr->Hide();
             mpFillGrad->Hide();
-            if (maContext != maImpressHandoutContext)
-                mpFillLB->Show();
             const Color aColor = GetColorSetOrDefault();
             mpFillLB->SelectEntry(aColor);
         }
@@ -541,6 +555,20 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
                     else
                         SetPanelTitle(SdResId(STR_SLIDE_NAME));
                 }
+                else if ( maContext == maImpressNotesContext )
+                {
+                    mpMasterLabel->SetText(SdResId(STR_MASTERSLIDE_NAME));
+                    ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
+
+                    if (pMainViewShell)
+                    {
+                        DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
+                        if ( pDrawViewShell->GetEditMode() == EditMode::MasterPage)
+                            SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
+                        else // EditMode::Page
+                            SetPanelTitle(SdResId(STR_SLIDE_NAME));
+                    }
+                }
                 mbTitle = true;
             }
         }
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index 3c7ff070f87c..8b7ad034b585 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -128,6 +128,7 @@ private:
     vcl::EnumContext maImpressOtherContext;
     vcl::EnumContext maImpressMasterContext;
     vcl::EnumContext maImpressHandoutContext;
+    vcl::EnumContext maImpressNotesContext;
     bool         mbTitle;
     std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
     std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;


More information about the Libreoffice-commits mailing list