summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2023-05-15 09:01:21 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2023-05-16 11:05:04 +0200
commit535f8fde0c33c435e4a8e9f768003516ce933666 (patch)
tree29b439a51e49d48f58d0fc9d5442e1bdd68a225a /sc/source
parent36eeb7a93174d17b08213eef7344952ae8e2e62e (diff)
tdf#141440 - Do not delete notes when pasting contents
Contents include cells with values, datetimes, strings, formulas, outlines, and sparklines. Change-Id: I9acf3a33c7723300d6b85f0abe468db28de6ebcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151759 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/document.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 25d0363c35f4..cab1dc364b31 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2905,8 +2905,9 @@ void ScDocument::CopyFromClip(
InsertDeleteFlags nDelFlag = InsertDeleteFlags::NONE;
if ( (nInsFlag & (InsertDeleteFlags::CONTENTS | InsertDeleteFlags::ADDNOTES)) == (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) )
nDelFlag |= InsertDeleteFlags::NOTE;
- else if ( nInsFlag & InsertDeleteFlags::CONTENTS )
- nDelFlag |= InsertDeleteFlags::CONTENTS;
+ // tdf#141440 - do not delete notes when pasting contents (see InsertDeleteFlags::CONTENTS)
+ else if ( nInsFlag & (InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE) )
+ nDelFlag |= InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE;
if (nInsFlag & InsertDeleteFlags::ATTRIB)
nDelFlag |= InsertDeleteFlags::ATTRIB;