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

Armin Le Grand Armin.Le.Grand at cib.de
Thu Nov 12 02:59:04 PST 2015


 svx/source/svdraw/svdmodel.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 1266429e91a56bcce59a7b98523e8edb8b22ed18
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Tue Nov 10 10:09:13 2015 +0100

    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

diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index de7e1c6..7a688da 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));


More information about the Libreoffice-commits mailing list