sc/source/core/data/column2.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 52fb77b4145e1206d164c36f045b367c684c266c
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Wed Mar 16 11:29:34 2022 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Thu Mar 31 07:39:30 2022 +0200

    lok: CopyCellNotesHandler: use the cloned object
    
    to get correct id for the new cell-note.
    
    Change-Id: I4df492ad91faad5797ba513f9a3aa9abd2baf88f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131690
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    (cherry picked from commit acafc2823f917b6f6299fa0b65a0d7461531c8a5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132171
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index f1a803750002..1f0ca6aad9d2 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1903,9 +1903,10 @@ public:
         SCROW nDestRow = nRow + mnDestOffset;
         ScAddress aSrcPos(mnSrcCol, nRow, mnSrcTab);
         ScAddress aDestPos(mnDestCol, nDestRow, mnDestTab);
-        miPos = mrDestNotes.set(miPos, nDestRow, p->Clone(aSrcPos, 
mrDestCol.GetDoc(), aDestPos, mbCloneCaption).release());
+        ScPostIt* pNew = p->Clone(aSrcPos, mrDestCol.GetDoc(), aDestPos, 
mbCloneCaption).release();
+        miPos = mrDestNotes.set(miPos, nDestRow, pNew);
         // Notify our LOK clients also
-        ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
&mrDestCol.GetDoc(), aDestPos, p);
+        ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, 
&mrDestCol.GetDoc(), aDestPos, pNew);
     }
 };
 

Reply via email to