summaryrefslogtreecommitdiff
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
committerEike Rathke <erack@redhat.com>2015-09-10 15:56:45 +0200
commit44f34c1163882c2e3086282374fee9cd55ee211f (patch)
treeea42ae2bc3bb86d704b5b9f846ea1e55b49e5384 /sc/source/ui/undo/undoblk.cxx
parentbb71e3a40067e4ef6c6879e6d26ad20f728dd822 (diff)
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
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 1430a12df683..8748a7b473c5 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1243,7 +1243,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 );