diff options
authorCaolán McNamara <>2016-07-04 17:09:11 +0100
committerCaolán McNamara <>2016-07-05 09:21:11 +0000
commitda2aad871bfccd28b47d8ddf47dd6b5b1f834220 (patch)
parent1b9f0082ba963baa37c8c565bab3b9b893e1a690 (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: Tested-by: Jenkins <> Reviewed-by: Eike Rathke <> Tested-by: Eike Rathke <> (cherry picked from commit 7566851d653ec052e9b7baa98ec2a993328f84e4) Reviewed-on: Reviewed-by: Caolán McNamara <> Tested-by: Caolán McNamara <>
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index f846028af0f7..fdecc5f5ab7e 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));