summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCzeber László Ádám <czeber.laszloadam@nisz.hu>2023-06-30 12:24:53 +0200
committerLászló Németh <nemeth@numbertext.org>2023-07-22 01:08:19 +0200
commitade2565cc2b2e5e8cf35fe828bf85649f7ff593a (patch)
tree80c2e45a5c1fdb7a9ece64eb7a5a2ad94e80220a
parentUpdate git submodules (diff)
downloadcore-ade2565cc2b2e5e8cf35fe828bf85649f7ff593a.tar.gz
core-ade2565cc2b2e5e8cf35fe828bf85649f7ff593a.zip
tdf#117307 sc: Comments are duplicated after Row delete and Undo
The comment was cloned if you deleted and restored its filtered cell. During Undo, the comment was cloned even if it was for the same cell, resulting duplicated comments there. Regression from commit eefe13c77d01be37c911e75af191717a944fedb3 "shrinking the DB area just causes problems, tdf#89546". Change-Id: I86d0813c56ba63370aae6b5f7807a19747e2378c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153803 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sc/source/core/data/postit.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 106a249e5666..cbb2eff1ff14 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -483,6 +483,9 @@ ScPostIt::~ScPostIt()
std::unique_ptr<ScPostIt> ScPostIt::Clone( const ScAddress& rOwnPos, ScDocument& rDestDoc, const ScAddress& rDestPos, bool bCloneCaption ) const
{
+ // tdf#117307: Don't clone comment, if it is in the same position
+ if ( (rOwnPos == rDestPos) && !mrDoc.IsClipboard() )
+ bCloneCaption = false;
CreateCaptionFromInitData( rOwnPos );
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 );