Kaydet (Commit) 1266429e authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Katarina Behrens

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
üst 1a494d9a
...@@ -1760,6 +1760,14 @@ void SdrModel::Merge(SdrModel& rSourceModel, ...@@ -1760,6 +1760,14 @@ void SdrModel::Merge(SdrModel& rSourceModel,
if(nNeuNum != 0xFFFF) 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) if(bUndo)
{ {
AddUndo(GetSdrUndoFactory().CreateUndoPageChangeMasterPage(*pPg)); AddUndo(GetSdrUndoFactory().CreateUndoPageChangeMasterPage(*pPg));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment