[Libreoffice-commits] core.git: officecfg/registry sd/inc sd/source sd/uiconfig

Susobhan Ghosh susobhang70 at gmail.com
Sat Aug 13 12:11:30 UTC 2016


 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |    1 
 sd/inc/glob.hrc                                              |    2 
 sd/source/core/glob.src                                      |    8 +
 sd/source/ui/sidebar/SlideBackground.cxx                     |   85 +++++++++--
 sd/source/ui/sidebar/SlideBackground.hxx                     |    8 +
 sd/uiconfig/simpress/ui/sidebarslidebackground.ui            |   53 +++++-
 6 files changed, 132 insertions(+), 25 deletions(-)

New commits:
commit 64ff7453408e578b95073db1740bfef4f500a2e4
Author: Susobhan Ghosh <susobhang70 at gmail.com>
Date:   Wed Aug 3 23:22:53 2016 +0530

    tdf#89466 Add Master Slide and Close Master View button
    
    Impress only. Change panel title on master slide context.
    Disable controls in master view.
    
    Change-Id: Ic355a6c74d3f61ea23bcf80e2a2d7e7d7a7980b8
    Reviewed-on: https://gerrit.libreoffice.org/27840
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Yousuf Philips <philipz85 at hotmail.com>
    Tested-by: Yousuf Philips <philipz85 at hotmail.com>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index e1e8cce..ac13581 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -747,6 +747,7 @@
             DrawImpress, HandoutPage,     visible, .uno:PageSetup  ;
             DrawImpress, NotesPage,       visible, .uno:PageSetup  ;
             DrawImpress, SlidesorterPage, visible, .uno:PageSetup  ;
+            DrawImpress, MasterPage,      visible, .uno:PageSetup  ;
           </value>
         </prop>
         <prop oor:name="ImplementationURL" oor:type="xs:string">
diff --git a/sd/inc/glob.hrc b/sd/inc/glob.hrc
index bec03c2..b950a51 100644
--- a/sd/inc/glob.hrc
+++ b/sd/inc/glob.hrc
@@ -136,6 +136,8 @@
 
 #define RID_SLIDESORTER_ICONS                   RID_GLOB_START+227
 #define STR_DEAUTHORISE_CLIENT                  RID_GLOB_START+229
+#define STR_MASTERSLIDE_NAME                    RID_GLOB_START+230
+#define STR_MASTERPAGE_NAME                     RID_GLOB_START+231
 
 #endif
 
diff --git a/sd/source/core/glob.src b/sd/source/core/glob.src
index d3b3a71..8e7fe18 100644
--- a/sd/source/core/glob.src
+++ b/sd/source/core/glob.src
@@ -55,6 +55,14 @@ String STR_SLIDE_NAME
 {
     Text [ en-US ] = "Slide" ;
 };
+String STR_MASTERSLIDE_NAME
+{
+    Text [ en-US ] = "Master Slide";
+};
+String STR_MASTERPAGE_NAME
+{
+    Text [ en-US ] = "Master Page";
+};
 String STR_MASTERPAGE
 {
     Text [ en-US ] = "Background" ;
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index a3c6ec9..7c9af4c 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -101,6 +101,7 @@ SlideBackground::SlideBackground(
     maDspBckController(SID_DISPLAY_MASTER_BACKGROUND, *pBindings, *this),
     maDspObjController(SID_DISPLAY_MASTER_OBJECTS, *pBindings, *this),
     maMetricController(SID_ATTR_METRIC, *pBindings, *this),
+    maCloseMasterController(SID_CLOSE_MASTER_VIEW, *pBindings, *this),
     mpColorItem(),
     mpGradientItem(),
     mpHatchItem(),
@@ -120,6 +121,9 @@ SlideBackground::SlideBackground(
     get(mpFillLB, "fillattr");
     get(mpDspMasterBackground, "displaymasterbackground");
     get(mpDspMasterObjects, "displaymasterobjects");
+    get(mpCloseMaster, "closemasterslide");
+    get(mpEditMaster, "masterslidebutton");
+    get(mpMasterLabel, "masterlabel");
     addListener();
     Initialize();
 }
@@ -129,13 +133,23 @@ SlideBackground::~SlideBackground()
     disposeOnce();
 }
 
+bool SlideBackground::IsDraw()
+{
+    return ( maApplication == vcl::EnumContext::Application_Draw );
+}
+
+bool SlideBackground::IsImpress()
+{
+    return ( maApplication == vcl::EnumContext::Application_Impress );
+}
+
 void SlideBackground::Initialize()
 {
     mpPaperSizeBox->FillPaperSizeEntries( PaperSizeDraw );
     mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
     mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
-
-
+    mpCloseMaster->Hide();
+    mpCloseMaster->SetClickHdl(LINK(this, SlideBackground, CloseMasterHdl));
     meUnit = maPaperSizeController.GetCoreMetric();
 
     mpMasterSlide->SetSelectHdl(LINK(this, SlideBackground, AssignMasterPage));
@@ -364,11 +378,34 @@ IMPL_LINK_TYPED(SlideBackground, EventMultiplexerListener,
                     EditMode eMode = pDrawViewShell->GetEditMode();
 
                     if ( eMode == EM_MASTERPAGE)
+                    {
+                        if( IsImpress() )
+                        {
+                            SetPanelTitle(SD_RESSTR(STR_MASTERSLIDE_NAME));
+                            mpEditMaster->Hide();
+                            mpCloseMaster->Show();
+                        }
+                        else
+                            SetPanelTitle(SD_RESSTR(STR_MASTERPAGE_NAME));
                         mpMasterSlide->Disable();
+                        mpDspMasterBackground->Disable();
+                        mpDspMasterObjects->Disable();
+                    }
                     else // EM_PAGE
+                    {
+                        if( IsImpress() )
+                        {
+                            SetPanelTitle(SD_RESSTR(STR_SLIDE_NAME));
+                            mpCloseMaster->Hide();
+                            mpEditMaster->Show();
+                        }
+                        else
+                            SetPanelTitle(SD_RESSTR(STR_PAGE_NAME));
                         mpMasterSlide->Enable();
+                        mpDspMasterBackground->Enable();
+                        mpDspMasterObjects->Enable();
+                    }
                 }
-
                 mbEditModeChangePending = false;
             }
         }
@@ -392,20 +429,37 @@ IMPL_LINK_TYPED(SlideBackground, EventMultiplexerListener,
         {
             if(!mbTitle)
             {
-                vcl::EnumContext rDrawContext(vcl::EnumContext::Application_Draw,
+                vcl::EnumContext aDrawOtherContext(vcl::EnumContext::Application_Draw,
                                               vcl::EnumContext::Context_DrawPage);
-                vcl::EnumContext rImpressContext(vcl::EnumContext::Application_Impress,
+                vcl::EnumContext aDrawMasterContext(vcl::EnumContext::Application_Draw,
+                                              vcl::EnumContext::Context_MasterPage);
+                vcl::EnumContext aImpressOtherContext(vcl::EnumContext::Application_Impress,
                                                  vcl::EnumContext::Context_DrawPage);
-                if(maContext == rDrawContext)
+                vcl::EnumContext aImpressMasterContext(vcl::EnumContext::Application_Impress,
+                                                       vcl::EnumContext::Context_MasterPage);
+                if(maContext == aDrawOtherContext || maContext == aDrawMasterContext)
                 {
-                    SetPanelTitle(SD_RESSTR(STR_PAGE_NAME));
-                    mbTitle = true;
+                    mpMasterLabel->SetText(SD_RESSTR(STR_MASTERPAGE_NAME));
+                    maApplication = vcl::EnumContext::Application_Draw;
+                    mpCloseMaster->Hide();
+                    mpEditMaster->Hide();
+                    if( maContext == aDrawMasterContext)
+                        SetPanelTitle(SD_RESSTR(STR_MASTERPAGE_NAME));
+                    else
+                        SetPanelTitle(SD_RESSTR(STR_PAGE_NAME));
                 }
-                else if(maContext == rImpressContext)
+                else if ( maContext == aImpressOtherContext || maContext == aImpressMasterContext )
                 {
-                    SetPanelTitle(SD_RESSTR(STR_SLIDE_NAME));
-                    mbTitle = true;
+                    mpMasterLabel->SetText(SD_RESSTR(STR_MASTERSLIDE_NAME));
+                    maApplication = vcl::EnumContext::Application_Impress;
+                    mpCloseMaster->Hide();
+                    mpEditMaster->Show();
+                    if( maContext == aImpressMasterContext )
+                        SetPanelTitle(SD_RESSTR(STR_MASTERSLIDE_NAME));
+                    else
+                        SetPanelTitle(SD_RESSTR(STR_SLIDE_NAME));
                 }
+                mbTitle = true;
             }
         }
         break;
@@ -458,6 +512,9 @@ void SlideBackground::dispose()
     mpFillLB.clear();
     mpDspMasterBackground.clear();
     mpDspMasterObjects.clear();
+    mpMasterLabel.clear();
+    mpEditMaster.clear();
+    mpCloseMaster.clear();
 
     maPaperSizeController.dispose();
     maPaperOrientationController.dispose();
@@ -470,6 +527,7 @@ void SlideBackground::dispose()
     maDspBckController.dispose();
     maDspObjController.dispose();
     maMetricController.dispose();
+    maCloseMasterController.dispose();
 
     PanelLayout::dispose();
 }
@@ -865,6 +923,11 @@ IMPL_LINK_NOARG_TYPED(SlideBackground, AssignMasterPage, ListBox&, void)
     pDoc->SetMasterPage(nSelectedPage, aLayoutName, pDoc, false, false);
 }
 
+IMPL_LINK_NOARG_TYPED(SlideBackground, CloseMasterHdl, Button*, void)
+{
+    GetBindings()->GetDispatcher()->Execute( SID_CLOSE_MASTER_VIEW, SfxCallMode::RECORD );
+}
+
 IMPL_LINK_NOARG_TYPED(SlideBackground, DspBackground, Button*, void)
 {
     bool IsChecked = mpDspMasterBackground->IsChecked();
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index 8080205..7e67f5e 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -84,6 +84,9 @@ private:
     VclPtr<ColorLB> mpFillGrad;
     VclPtr<CheckBox> mpDspMasterBackground;
     VclPtr<CheckBox> mpDspMasterObjects;
+    VclPtr<Button> mpCloseMaster;
+    VclPtr<Button> mpEditMaster;
+    VclPtr<FixedText> mpMasterLabel;
 
     ::sfx2::sidebar::ControllerItem maPaperSizeController;
     ::sfx2::sidebar::ControllerItem maPaperOrientationController;
@@ -96,6 +99,7 @@ private:
     ::sfx2::sidebar::ControllerItem maDspBckController;
     ::sfx2::sidebar::ControllerItem maDspObjController;
     ::sfx2::sidebar::ControllerItem maMetricController;
+    ::sfx2::sidebar::ControllerItem maCloseMasterController;
 
     std::unique_ptr< XFillColorItem > mpColorItem;
     std::unique_ptr< XFillGradientItem > mpGradientItem;
@@ -106,6 +110,7 @@ private:
 
     css::uno::Reference<css::frame::XFrame> mxFrame;
     vcl::EnumContext maContext;
+    vcl::EnumContext::Application maApplication;
     bool         mbTitle;
     SfxBindings* mpBindings;
 
@@ -118,6 +123,7 @@ private:
     DECL_LINK_TYPED(AssignMasterPage, ListBox&, void);
     DECL_LINK_TYPED(DspBackground, Button*, void);
     DECL_LINK_TYPED(DspObjects, Button*, void);
+    DECL_LINK_TYPED(CloseMasterHdl, Button*, void);
     DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
 
     void Initialize();
@@ -129,6 +135,8 @@ private:
     const OUString GetHatchingSetOrDefault();
     const OUString GetBitmapSetOrDefault();
     const OUString GetPatternSetOrDefault();
+    bool IsImpress();
+    bool IsDraw();
     void addListener();
     void removeListener();
     void populateMasterSlideDropdown();
diff --git a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
index ccd1c5c..1c9cfe8 100644
--- a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
+++ b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
@@ -77,18 +77,6 @@
           </packing>
         </child>
         <child>
-          <object class="GtkButton" id="button1">
-            <property name="label" translatable="yes">Edit Master Slide</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="action_name">.uno:SlideMasterPage</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="top_attach">10</property>
-          </packing>
-        </child>
-        <child>
           <object class="GtkCheckButton" id="displaymasterobjects">
             <property name="label" translatable="yes">Display Objects</property>
             <property name="use_action_appearance">True</property>
@@ -114,12 +102,11 @@
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label1">
+          <object class="GtkLabel" id="masterlabel">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="halign">end</property>
             <property name="hexpand">True</property>
-            <property name="label" translatable="yes">Master Slide:</property>
             <property name="ellipsize">end</property>
           </object>
           <packing>
@@ -197,6 +184,44 @@
           </packing>
         </child>
         <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="homogeneous">True</property>
+            <child>
+              <object class="GtkButton" id="masterslidebutton">
+                <property name="label" translatable="yes">Master Slide</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="action_name">.uno:SlideMasterPage</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="closemasterslide">
+                <property name="label" translatable="yes">Close Master Slide</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">10</property>
+          </packing>
+        </child>
+        <child>
           <placeholder/>
         </child>
         <child>


More information about the Libreoffice-commits mailing list