sc/qa/unit/ucalc_copypaste.cxx | 14 ++++++-------- sc/source/core/data/document.cxx | 7 ++----- 2 files changed, 8 insertions(+), 13 deletions(-)
New commits: commit 0bf9babcd3259cc57591594f03c974cf0ec53080 Author: Andreas Heinisch <andreas.heini...@yahoo.de> AuthorDate: Sat Jul 20 21:45:34 2024 +0200 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Mon Oct 28 14:01:30 2024 +0100 tdf#161189 - CopyFromClip: improve handling of deleting notes Instead of adding additional deletion flags, just remove the note deletetion flag when needed. Change-Id: Iba0dd4f922694c9fff98f4b74bccad1b8ee16d49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170803 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> (cherry picked from commit e747986af4dbb6b48957092dadce26a95b910a82) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172128 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 70a34d6b8bb4a4ecc89f1ceafaa2ea5d3a67acf8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172132 Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175663 Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index bec9bb499b94..1c1bd833b5d8 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -9408,11 +9408,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) // Check the content after the paste. { - // tdf#141440 - do not delete notes when pasting contents static const Check aChecks[] = { - { "Clip1", COL_YELLOW, true }, { "B", COL_BLUE, true }, - { "Clip2", COL_YELLOW, true }, { "D", COL_BLUE, true }, - { "Clip3", COL_YELLOW, true }, + { "Clip1", COL_YELLOW, false }, { "B", COL_BLUE, true }, + { "Clip2", COL_YELLOW, false }, { "D", COL_BLUE, true }, + { "Clip3", COL_YELLOW, false }, }; bool bRes @@ -9436,11 +9435,10 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) // Redo, and check the content again. aUndo.Redo(); { - // tdf#141440 - do not delete notes when pasting contents static const Check aChecks[] = { - { "Clip1", COL_YELLOW, true }, { "B", COL_BLUE, true }, - { "Clip2", COL_YELLOW, true }, { "D", COL_BLUE, true }, - { "Clip3", COL_YELLOW, true }, + { "Clip1", COL_YELLOW, false }, { "B", COL_BLUE, true }, + { "Clip2", COL_YELLOW, false }, { "D", COL_BLUE, true }, + { "Clip3", COL_YELLOW, false }, }; bool bRes diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 2bca3a798fb1..92609e2dce4f 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2907,12 +2907,9 @@ void ScDocument::CopyFromClip( overwrite/delete existing cells but to insert the notes into these cells. In this case, just delete old notes from the destination area. */ - InsertDeleteFlags nDelFlag = InsertDeleteFlags::NONE; + InsertDeleteFlags nDelFlag = nInsFlag; if ( (nInsFlag & (InsertDeleteFlags::CONTENTS | InsertDeleteFlags::ADDNOTES)) == (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES) ) - nDelFlag |= InsertDeleteFlags::NOTE; - // tdf#141440 - do not delete notes when pasting contents (see InsertDeleteFlags::CONTENTS) - else if ( nInsFlag & (InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE) ) - nDelFlag |= InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE; + nDelFlag &= ~InsertDeleteFlags::NOTE; if (nInsFlag & InsertDeleteFlags::ATTRIB) nDelFlag |= InsertDeleteFlags::ATTRIB;