summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2022-03-15 13:00:35 +0530
committerSzymon Kłos <szymon.klos@collabora.com>2022-03-24 14:13:56 +0100
commitdd229e4cd9a0211c9a80031da1d2f7fb71b6683e (patch)
treeae54dd05433e57b021360bf0031229067087c369
parentUse correct language for spellchecking in calc (diff)
downloadcore-dd229e4cd9a0211c9a80031da1d2f7fb71b6683e.tar.gz
core-dd229e4cd9a0211c9a80031da1d2f7fb71b6683e.zip
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--sc/source/core/data/postit.cxx4
1 files changed, 3 insertions, 1 deletions
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 )