From f4933afbd70136e3873f8197314ea41c1095076c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 4 Jul 2016 17:09:11 +0100 Subject: Resolves: tdf#91995 copying cells to undo doc shallow copied note pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit 7566851d653ec052e9b7baa98ec2a993328f84e4) Reviewed-on: https://gerrit.libreoffice.org/26940 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit 7bcd59241495fe474387abb176185d8775aa104c) --- sc/source/core/data/column.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index d4b5a2e0b4e7..9ddb819a6918 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(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)); } -- cgit