sd/source/ui/sidebar/SlideBackground.cxx |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 32cf800f88be1348bf0ad5297cf353566aeac790
Author:     dldld <libreofficecontribut...@dldld.de>
AuthorDate: Wed Dec 18 20:38:21 2019 +0100
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Mon Feb 3 08:44:20 2020 +0100

    tdf#127137 Allow assigning of master slide to multiple slides
    
    The old code was only able to set the master page for the first selected 
page which
    has now been changed to be set in all currently selected pages
    
    Change-Id: Id6826f87ed7d12abb220ea1871af06626d67112e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85424
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx 
b/sd/source/ui/sidebar/SlideBackground.cxx
index ee24a21cfe47..85a9671b171b 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -20,6 +20,10 @@
 #include <com/sun/star/ui/XDeck.hpp>
 #include <com/sun/star/ui/XPanel.hpp>
 #include <com/sun/star/frame/XController2.hpp>
+#include <SlideSorter.hxx>
+#include <SlideSorterViewShell.hxx>
+#include <controller/SlideSorterController.hxx>
+#include <controller/SlsPageSelector.hxx>
 #include "SlideBackground.hxx"
 #include <sdresid.hxx>
 #include <ViewShellBase.hxx>
@@ -1160,17 +1164,22 @@ IMPL_LINK_NOARG(SlideBackground, AssignMasterPage, 
weld::ComboBox&, void)
     SdDrawDocument* pDoc = pDocSh ? pDocSh->GetDoc() : nullptr;
     if (!pDoc)
         return;
-    sal_uInt16 nSelectedPage = SDRPAGE_NOTFOUND;
+
+    auto pSSVS = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(mrBase);
+    if (pSSVS == nullptr)
+        return;
+
+    auto& rSSController = pSSVS->GetSlideSorter().GetController();
+    auto& rPageSelector = rSSController.GetPageSelector();
+
     for( sal_uInt16 nPage = 0; nPage < 
pDoc->GetSdPageCount(PageKind::Standard); nPage++ )
     {
-        if (pDoc->GetSdPage(nPage,PageKind::Standard)->IsSelected())
+        if (rPageSelector.IsPageSelected(nPage))
         {
-            nSelectedPage = nPage;
-            break;
+            OUString aLayoutName(mxMasterSlide->get_active_text());
+            pDoc->SetMasterPage(nPage, aLayoutName, pDoc, false, false);
         }
     }
-    OUString aLayoutName(mxMasterSlide->get_active_text());
-    pDoc->SetMasterPage(nSelectedPage, aLayoutName, pDoc, false, false);
 }
 
 IMPL_LINK_NOARG(SlideBackground, EditMasterHdl, weld::Button&, void)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to