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

Caolán McNamara caolanm at redhat.com
Fri Nov 10 23:47:48 UTC 2017


 sd/source/ui/view/ViewClipboard.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 574bac673366bc317e8ef10f288945d8dd5c2050
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 10 16:16:01 2017 +0000

    Resolves: tdf#113405 don't try and assign a master page to a master page
    
    when in master view mode go straight to adding the master page to the
    list of masters
    
    Change-Id: I345ce30b44099cd546267fb2acae0b1cc8a73dbe
    Reviewed-on: https://gerrit.libreoffice.org/44606
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx
index cb28d4b1a974..38b1a9ebea47 100644
--- a/sd/source/ui/view/ViewClipboard.cxx
+++ b/sd/source/ui/view/ViewClipboard.cxx
@@ -20,6 +20,7 @@
 #include <ViewClipboard.hxx>
 
 #include <DrawDocShell.hxx>
+#include <DrawViewShell.hxx>
 #include <View.hxx>
 #include <ViewShell.hxx>
 #include <Window.hxx>
@@ -49,8 +50,11 @@ void ViewClipboard::HandlePageDrop (const SdTransferable& rTransferable)
 {
     // Determine whether to insert the given set of slides or to assign a
     // given master page.
-    SdPage* pMasterPage = GetFirstMasterPage (rTransferable);
-    if (pMasterPage != nullptr)
+    // tdf#113405 only assign master pages to normal pages, don't attempt to assign a master
+    // page to a master page
+    sd::DrawViewShell* pDrawViewShell = dynamic_cast<::sd::DrawViewShell*>(mrView.GetViewShell());
+    SdPage* pMasterPage = (pDrawViewShell && pDrawViewShell->GetEditMode() == EditMode::Page) ? GetFirstMasterPage(rTransferable) : nullptr;
+    if (pMasterPage)
         AssignMasterPage (rTransferable, pMasterPage);
     else
         InsertSlides (rTransferable, DetermineInsertPosition (rTransferable));


More information about the Libreoffice-commits mailing list