summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-10 16:16:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-11 00:47:06 +0100
commit574bac673366bc317e8ef10f288945d8dd5c2050 (patch)
tree188dc8f5460451e4381b90f4e73372522a4fc3bf
parent8a5a9e05cce756e9f7aa11b86972939a8a70a839 (diff)
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@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/ui/view/ViewClipboard.cxx8
1 files changed, 6 insertions, 2 deletions
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));