tdf#148088: Fix master related UI in Draw

Page/Master Page... -> Page/Change Master Page... (corresponds to Impress)
In the above dialog:
Available Master Slides -> Available Master Pages
Select a Slide Design -> Select a Page Design
After clickling load:
Load Master Slide -> Load Master Page
In Master mode, right click/Rename Master:
Rename Master Slide -> Rename Master Page

Change-Id: I6a8e987d6f3eaf91289ec061ec87cd76b3f90ca2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151489
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <[email protected]>
Reviewed-by: Heiko Tietze <[email protected]>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 716d496..cca1b2e 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -1103,7 +1103,7 @@
      </node>
      <node oor:name=".uno:DrawingLayout" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Master Page...</value>
          <value xml:lang="en-US">Change Master Page...</value>
        </prop>
        <prop oor:name="TargetURL" oor:type="xs:string">
          <value>.uno:PresentationLayout</value>
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index bf5372b..3e1ddd1 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -159,7 +159,12 @@

// Strings for animation effects
#define STR_INSERT_TEXT                                 NC_("STR_INSERT_TEXT", "Insert Text")
#define STR_AVAILABLE_MASTERSLIDE                       NC_("STR_AVAILABLE_MASTERSLIDE", "Available Master Slides")
#define STR_AVAILABLE_MASTERPAGE                        NC_("STR_AVAILABLE_MASTERPAGE", "Available Master Pages")
#define STR_SELECT_SLIDE                                NC_("STR_SELECT_SLIDE", "Select a Slide Design")
#define STR_SELECT_PAGE                                 NC_("STR_SELECT_PAGE", "Select a Page Design")
#define STR_LOAD_PRESENTATION_LAYOUT                    NC_("STR_LOAD_PRESENTATION_LAYOUT", "Load Master Slide")
#define STR_LOAD_DRAWING_LAYOUT                         NC_("STR_LOAD_DRAWING_LAYOUT", "Load Master Page")
#define STR_GLUE_ESCDIR_SMART                           NC_("STR_GLUE_ESCDIR_SMART", "Smart")
#define STR_GLUE_ESCDIR_LEFT                            NC_("STR_GLUE_ESCDIR_LEFT", "Left")
#define STR_GLUE_ESCDIR_RIGHT                           NC_("STR_GLUE_ESCDIR_RIGHT", "Right")
@@ -238,7 +243,8 @@
#define STR_TITLE_RENAMEPAGE                            NC_("STR_TITLE_RENAMEPAGE", "Rename Page")
#define STR_TOOLTIP_RENAME                              NC_("STR_TOOLTIP_RENAME", "Duplicate or empty names are not possible")
#define STR_DESC_RENAMESLIDE                            NC_("STR_DESC_RENAMESLIDE", "Name")
#define STR_TITLE_RENAMEMASTER                          NC_("STR_TITLE_RENAMEMASTER", "Rename Master Slide")
#define STR_TITLE_RENAMEMASTERSLIDE                     NC_("STR_TITLE_RENAMEMASTERSLIDE", "Rename Master Slide")
#define STR_TITLE_RENAMEMASTERPAGE                      NC_("STR_TITLE_RENAMEMASTERPAGE", "Rename Master Page")
#define STR_PLACEHOLDER_DESCRIPTION_TITLE               NC_("STR_PLACEHOLDER_DESCRIPTION_TITLE", "Title Area for AutoLayouts" )
#define STR_PLACEHOLDER_DESCRIPTION_OUTLINE             NC_("STR_PLACEHOLDER_DESCRIPTION_OUTLINE", "Object Area for AutoLayouts" )
#define STR_PLACEHOLDER_DESCRIPTION_FOOTER              NC_("STR_PLACEHOLDER_DESCRIPTION_FOOTER", "Footer Area" )
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index dd54611..d0d0839b 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -47,7 +47,18 @@ SdPresLayoutDlg::SdPresLayoutDlg(::sd::DrawDocShell* pDocShell,
    , m_xBtnLoad(m_xBuilder->weld_button("load"))
    , m_xVS(new ValueSet(m_xBuilder->weld_scrolled_window("selectwin", true)))
    , m_xVSWin(new weld::CustomWeld(*m_xBuilder, "select", *m_xVS))
    , m_xLabel(m_xBuilder->weld_label("label1"))
{
    if (mpDocSh->GetDoc()->GetDocumentType() == DocumentType::Draw)
    {
        m_xDialog->set_title(SdResId(STR_AVAILABLE_MASTERPAGE));
        m_xLabel->set_label(SdResId(STR_SELECT_PAGE));
    }
    else
    {
        m_xDialog->set_title(SdResId(STR_AVAILABLE_MASTERSLIDE));
        m_xLabel->set_label(SdResId(STR_SELECT_SLIDE));
    }
    m_xVSWin->set_size_request(m_xBtnLoad->get_approximate_digit_width() * 60,
                               m_xBtnLoad->get_text_height() * 20);

@@ -172,7 +183,10 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLayoutHdl, ValueSet*, void)
IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl, weld::Button&, void)
{
    SfxNewFileDialog aDlg(m_xDialog.get(), SfxNewFileDialogMode::Preview);
    aDlg.set_title(SdResId(STR_LOAD_PRESENTATION_LAYOUT));
    if (mpDocSh->GetDoc()->GetDocumentType() == DocumentType::Draw)
        aDlg.set_title(SdResId(STR_LOAD_DRAWING_LAYOUT));
    else
        aDlg.set_title(SdResId(STR_LOAD_PRESENTATION_LAYOUT));
    sal_uInt16 nResult = aDlg.run();

    bool   bCancel = false;
diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx
index 77187a0..2e87b66 100644
--- a/sd/source/ui/inc/sdpreslt.hxx
+++ b/sd/source/ui/inc/sdpreslt.hxx
@@ -62,6 +62,7 @@ private:
    std::unique_ptr<weld::Button> m_xBtnLoad;
    std::unique_ptr<ValueSet> m_xVS;
    std::unique_ptr<weld::CustomWeld> m_xVSWin;
    std::unique_ptr<weld::Label> m_xLabel;

    void                FillValueSet();
    void                Reset();
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index d1c130a..41a6b64 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -888,11 +888,19 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest)
    // master slides or normal ones
    OUString aTitle;
    if( rRequest.GetSlot() == SID_RENAME_MASTER_PAGE )
        aTitle = SdResId( STR_TITLE_RENAMEMASTER );
    else if (pDrView->GetDoc().GetDocumentType() == DocumentType::Draw)
        aTitle = SdResId( STR_TITLE_RENAMEPAGE );
    {
        if (pDrView->GetDoc().GetDocumentType() == DocumentType::Draw)
            aTitle = SdResId( STR_TITLE_RENAMEMASTERPAGE );
        else
            aTitle = SdResId( STR_TITLE_RENAMEMASTERSLIDE );
    }
    else
        aTitle = SdResId( STR_TITLE_RENAMESLIDE );
    {
        if (pDrView->GetDoc().GetDocumentType() == DocumentType::Draw)
            aTitle = SdResId( STR_TITLE_RENAMEPAGE );
        else
            aTitle = SdResId( STR_TITLE_RENAMESLIDE );
    }

    OUString aDescr( SdResId( STR_DESC_RENAMESLIDE ) );
    OUString aPageName = pSelectedPage->GetName();
diff --git a/sd/uiconfig/sdraw/popupmenu/page.xml b/sd/uiconfig/sdraw/popupmenu/page.xml
index 1da8639..6fcedee 100644
--- a/sd/uiconfig/sdraw/popupmenu/page.xml
+++ b/sd/uiconfig/sdraw/popupmenu/page.xml
@@ -47,6 +47,6 @@
    </menu:menupopup>
  </menu:menu>
  <menu:menuitem menu:id=".uno:SaveBackground"/>
  <menu:menuitem menu:id=".uno:PresentationLayout"/>
  <menu:menuitem menu:id=".uno:DrawingLayout"/>
  <menu:menuitem menu:id=".uno:PageSetup"/>
</menu:menupopup>
diff --git a/sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml b/sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml
index bf160df..a003a78 100644
--- a/sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml
+++ b/sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml
@@ -16,5 +16,5 @@
  <menu:menuitem menu:id=".uno:DeleteMasterPage"/>
  <menu:menuitem menu:id=".uno:RenameMasterPage"/>
  <menu:menuseparator/>
  <menu:menuitem menu:id=".uno:PresentationLayout"/>
  <menu:menuitem menu:id=".uno:DrawingLayout"/>
</menu:menupopup>
diff --git a/sd/uiconfig/sdraw/ui/notebookbar.ui b/sd/uiconfig/sdraw/ui/notebookbar.ui
index f0bf873..bea7d9e 100644
--- a/sd/uiconfig/sdraw/ui/notebookbar.ui
+++ b/sd/uiconfig/sdraw/ui/notebookbar.ui
@@ -1351,7 +1351,7 @@
      <object class="GtkMenuItem" id="MenuSlide-PresentationLayout">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="action_name">.uno:PresentationLayout</property>
        <property name="action_name">.uno:DrawingLayout</property>
      </object>
    </child>
    <child>
@@ -6197,7 +6197,7 @@
                            <child>
                              <object class="GtkToolButton" id="Page-PresentationLayout">
                                <property name="visible">True</property>
                                <property name="action_name">.uno:PresentationLayout</property>
                                <property name="action_name">.uno:DrawingLayout</property>
                              </object>
                              <packing>
                                <property name="expand">False</property>
diff --git a/sd/uiconfig/sdraw/ui/notebookbar_compact.ui b/sd/uiconfig/sdraw/ui/notebookbar_compact.ui
index 34d593d..b9582b7 100644
--- a/sd/uiconfig/sdraw/ui/notebookbar_compact.ui
+++ b/sd/uiconfig/sdraw/ui/notebookbar_compact.ui
@@ -1259,7 +1259,7 @@
      <object class="GtkMenuItem" id="MenuSlide-PresentationLayout">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="action_name">.uno:PresentationLayout</property>
        <property name="action_name">.uno:DrawingLayout</property>
      </object>
    </child>
    <child>
@@ -5902,7 +5902,7 @@
                            <child>
                              <object class="GtkToolButton" id="Page-PresentationLayout">
                                <property name="visible">True</property>
                                <property name="action_name">.uno:PresentationLayout</property>
                                <property name="action_name">.uno:DrawingLayout</property>
                              </object>
                              <packing>
                                <property name="expand">False</property>
diff --git a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
index 614e195..cbb04e7 100644
--- a/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
+++ b/sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui
@@ -2759,7 +2759,7 @@
      <object class="GtkMenuItem" id="MenuSlide-PresentationLayout">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="action_name">.uno:PresentationLayout</property>
        <property name="action_name">.uno:DrawingLayout</property>
      </object>
    </child>
    <child>