From 574bac673366bc317e8ef10f288945d8dd5c2050 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 10 Nov 2017 16:16:01 +0000 Subject: Resolves: tdf#113405 don't try and assign a master page to a master page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sd/source/ui/view/ViewClipboard.cxx | 8 ++++++-- 1 file 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 #include +#include #include #include #include @@ -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)); -- cgit v1.2.3