summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-04 17:09:11 +0100
committerEike Rathke <erack@redhat.com>2016-07-05 09:14:16 +0000
commit7566851d653ec052e9b7baa98ec2a993328f84e4 (patch)
tree6d082e78da208196648823a6f545c733bdeca716
parent80509950d35cebaede89fcb52c446a1fd3e45ba3 (diff)
Resolves: tdf#91995 copying cells to undo doc shallow copied note pointer
maybe UpdateCaptionPos isn't needed if we do it this way and deep copy it. surely we have to copy the note here, otherwise it gets deleted by both the source and destination document Change-Id: I6bc885c45b2938d0c775572c48642e67cd1ef5ca Reviewed-on: https://gerrit.libreoffice.org/26913 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/data/column.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 40132082f46d..5766c72efa4f 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1208,6 +1208,10 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDes
ScPostIt* pNote = maCellNotes.get<ScPostIt*>(nSrcRow);
if (pNote)
{
+ pNote = pNote->Clone(ScAddress(nCol, nSrcRow, nTab),
+ rDestCol.GetDoc(),
+ ScAddress(rDestCol.nCol, nDestRow, rDestCol.nTab),
+ false);
rDestCol.maCellNotes.set(nDestRow, pNote);
pNote->UpdateCaptionPos(ScAddress(rDestCol.nCol, nDestRow, rDestCol.nTab));
}