sc/source/core/data/column2.cxx | 5 +++-- sc/source/core/data/postit.cxx | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-)
New commits: commit acafc2823f917b6f6299fa0b65a0d7461531c8a5 Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Wed Mar 16 11:29:34 2022 +0530 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Thu Mar 24 14:14:13 2022 +0100 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> diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 886dab8f5ab8..25f7bdd12f86 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1866,9 +1866,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); } }; commit dd229e4cd9a0211c9a80031da1d2f7fb71b6683e Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Tue Mar 15 13:00:35 2022 +0530 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Thu Mar 24 14:13:56 2022 +0100 lok: ensure unique id for annotations Problem: When a cell containing comment is copied and pasted to another cell, the cloned comment/annotation in the target cell has the same id as the original one. The lok clients depend upon the id of each comment to identify them and update coordinates when updates are requested through .uno:ViewAnnotationsPosition. So the client does not have enough information to distinguish between comments of same id. Change-Id: Iebd7281113e0830826aff1bbdaae234bd5d5cd4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131689 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index bafd2e9e901b..2e85eb0faf08 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -28,6 +28,7 @@ #include <editeng/outlobj.hxx> #include <editeng/editobj.hxx> #include <basegfx/polygon/b2dpolygon.hxx> +#include <comphelper/lok.hxx> #include <scitems.hxx> #include <svx/xfillit0.hxx> @@ -876,7 +877,8 @@ ScPostIt::~ScPostIt() std::unique_ptr<ScPostIt> ScPostIt::Clone( const ScAddress& rOwnPos, ScDocument& rDestDoc, const ScAddress& rDestPos, bool bCloneCaption ) const { CreateCaptionFromInitData( rOwnPos ); - return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, *this, mnPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos, maNoteData, false, mnPostItId ); + sal_uInt32 nPostItId = comphelper::LibreOfficeKit::isActive() ? 0 : mnPostItId; + return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, *this, nPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos, maNoteData, false, mnPostItId ); } void ScPostIt::SetDate( const OUString& rDate )