summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2015-11-10 10:09:13 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2015-11-12 11:56:53 +0100
commit1266429e91a56bcce59a7b98523e8edb8b22ed18 (patch)
tree180bdb5edd66e2fe5daa1410906cd7602655f226
parent1a494d9a00208eef790400bdbd8b3e5c7fed4886 (diff)
tdf#90357 create correct undo action
when merging in pages from another model the already cloned page references a masterpage from the old model. To not create an undo action that falsely reflects that, remove the masterpage from the page first. This reflects better what happens in this state, setting the masterpage for this page the first time. Change-Id: I0288268cb0963ddc2e8446661ffd30a94a0744d2
-rw-r--r--svx/source/svdraw/svdmodel.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index de7e1c62fc33..7a688dac7c6d 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1760,6 +1760,14 @@ void SdrModel::Merge(SdrModel& rSourceModel,
if(nNeuNum != 0xFFFF)
{
+ // tdf#90357 here pPg and the to-be-set new masterpage are parts of the new model
+ // already, but the currently set masterpage is part of the old model. Remove master
+ // page from already cloned page to prevent creating wrong undo action that can
+ // eventually crash the app.
+ // Do *not* remove it directly after cloning - the old masterpage is still needed
+ // later to find the new to-be-set masterpage.
+ pPg->TRG_ClearMasterPage();
+
if(bUndo)
{
AddUndo(GetSdrUndoFactory().CreateUndoPageChangeMasterPage(*pPg));