Bug 158110

Summary: Copy/paste of Calc comments fails when more than one cell is copied
Product: LibreOffice Reporter: Seppi <Josef.Teske>
Component: CalcAssignee: Andreas Heinisch <andreas.heinisch>
Status: RESOLVED FIXED    
Severity: normal CC: buzea.bogdan, miguelangelrv, stephane.guillou
Priority: medium Keywords: bibisected, bisected, regression
Version: 7.6.0.0 alpha1+   
Hardware: x86-64 (AMD64)   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=160765
https://bugs.documentfoundation.org/show_bug.cgi?id=139858
Whiteboard: target:24.8.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 101216, 108479    

Description Seppi 2023-11-08 08:15:50 UTC
Description:
Add comments in two different cells.  Mark and copy them.  Go to another cell an paste the comments selectively using options "comments" and "adding".  After pasting that way the comments doesn't appear.  By copy/paste the comments one by one it works.  Same behaviour in versions 7.6.1.2 and 7.6.2.1.  Version 7.5.7.1 worked fine.

Steps to Reproduce:
1.Open a new empty calc document.
2.Go to an arbitrary cell, for example B2.
3.Create there a new comment, for example "Test 1".
4.Go to an other cell, for example B3 and create here a new comment "Test 2".
5.Mark both cells B2 and B3 and copy them (Ctrl-c).
6.Go to an other cell, for example D2 and insert the comments selectively by adding them: german menu Bearbeiten → Inhalte einfügen.  Choose there the options comments and add.  Click on "OK".
7.Do the same with both comments but one by one and it works as expected.

Actual Results:
to 6.: Result is that the cells D2 and D3 are marked but the comments are missing.  If you do the paste step again, the option "comments" isn't marked anymore.
to 7.: The comments are correctly pasted, but it's too much effort for many cells.

Expected Results:
The comments of many cells should be pasted selectively and the other cell contents and properties should be untouched.  This is only the case, if you copy/paste the comments by only one cell at a time.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 12; OS: Linux 5.6; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
Comment 1 m_a_riosv 2023-11-08 13:08:14 UTC
Reproducible
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 026be6f62f183f14b9c0bf2e50cde9ac69856f53
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 2 m_a_riosv 2024-04-29 22:40:03 UTC
*** Bug 160859 has been marked as a duplicate of this bug. ***
Comment 3 Stéphane Guillou (stragu) 2024-04-30 04:51:07 UTC
From my comment in duplicate:

Steps:
1. Insert a comment in cell A1
2. Copy range A1:A2
3. Paste special into B1, with only option "Only comments" ticked

Results: no comment pasted in target

Reproduced in:
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d4f6534e8870e8f271984c37ce54a6878f372ae1
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3

Same on Windows 11.

Bibisected with linux-64-7.6 repo to first bad commit d82812a13723fc093897c1b27d29ac263c66d0d0 which points to:

commit 28bcb35b12f19858eca3d08559d7914e36ad1d2b
Author: Andreas Heinisch
Date:   Wed May 10 09:08:47 2023 +0200
    tdf#139858 - Do not delete existing cell contents when pasting notes
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151603
Comment 4 Commit Notification 2024-05-22 05:28:03 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/76941af9837406b1526b2f2d13c89df7a2023072

tdf#158110 - Paste special: Remove special ADDNOTES flag handling

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.