summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/undo/undoblk.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-09-10 15:52:21 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-19 21:32:11 +0200
commit1495b641c2bd6f073909c2b5a35a6d3c4f9d95a7 (patch)
tree9e2362ba15c057907bcc5115772f04a64f234b24 /sc/source/ui/undo/undoblk.cxx
parentwindows opengl: mpProgram seen as 0 (diff)
downloadcore-1495b641c2bd6f073909c2b5a35a6d3c4f9d95a7.tar.gz
core-1495b641c2bd6f073909c2b5a35a6d3c4f9d95a7.zip
Resolves: tdf#92995 do not delete caption objects that are held by Undo
Drag&Drop Undo is a special case of ownership.. Change-Id: I2fe7769c4d84efe09d432335d5d8e72d506bf7a1 (cherry picked from commit 44f34c1163882c2e3086282374fee9cd55ee211f) Reviewed-on: https://gerrit.libreoffice.org/18470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/undo/undoblk.cxx')
-rw-r--r--sc/source/ui/undo/undoblk.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 2154466e9732..9cecfa029045 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1239,7 +1239,14 @@ void ScUndoDragDrop::DoUndo( ScRange aRange )
// do not undo objects and note captions, they are handled via drawing undo
InsertDeleteFlags nUndoFlags = (IDF_ALL & ~IDF_OBJECTS) | IDF_NOCAPTIONS;
- rDoc.DeleteAreaTab( aRange, nUndoFlags );
+ // Additionally discard/forget caption ownership during deletion, as
+ // Drag&Drop is a special case in that the Undo holds captions of the
+ // transfered target range, which would get deleted and
+ // SdrGroupUndo::Undo() would attempt to access invalidated captions and
+ // crash, tdf#92995
+ InsertDeleteFlags nDelFlags = nUndoFlags | IDF_FORGETCAPTIONS;
+
+ rDoc.DeleteAreaTab( aRange, nDelFlags );
pRefUndoDoc->CopyToDocument( aRange, nUndoFlags, false, &rDoc );
if ( rDoc.HasAttrib( aRange, HASATTR_MERGED ) )
rDoc.ExtendMerge( aRange, true );