summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/undo
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-17 23:54:21 +0100
committerEike Rathke <erack@redhat.com>2017-02-18 00:02:04 +0100
commita627c44026fcf883918f84bddd1c3b745e1f898c (patch)
tree60c8cd70da7e493c0c5420a180140f74a152573c /sc/source/ui/undo
parentPivot dialog: use C++11 feat., get rid of using namespace std (diff)
downloadcore-a627c44026fcf883918f84bddd1c3b745e1f898c.tar.gz
core-a627c44026fcf883918f84bddd1c3b745e1f898c.zip
Resolves: tdf#105667 forget target area's caption pointer in Merge Undo
It's the same that was copied to the Undo document, so don't delete the caption. Change-Id: Ib89870ed6e392c4271de2f416c78d42135922609
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r--sc/source/ui/undo/undoblk3.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 7a6038bed0ba..5fe6c5ebd3b6 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -699,7 +699,13 @@ void ScUndoMerge::DoChange( bool bUndo ) const
// undo -> copy back deleted contents
if (bUndo && mpUndoDoc)
{
- rDoc.DeleteAreaTab( aRange, InsertDeleteFlags::CONTENTS|InsertDeleteFlags::NOCAPTIONS );
+ // If there are note captions to be deleted during Undo they were
+ // kept or moved during the merge and copied to the Undo document
+ // without cloning the caption. Forget the target area's caption
+ // pointer that is identical to the one in the Undo document
+ // instead of deleting it.
+ rDoc.DeleteAreaTab( aRange,
+ InsertDeleteFlags::CONTENTS | InsertDeleteFlags::NOCAPTIONS | InsertDeleteFlags::FORGETCAPTIONS );
mpUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, rDoc);
}