Bug 98442 - Redo of editing incomplete in comment editing
Summary: Redo of editing incomplete in comment editing
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Comments
  Show dependency treegraph
 
Reported: 2016-03-05 08:29 UTC by Luke Kendall
Modified: 2021-12-03 07:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample files to reproduce the problm (24.52 KB, application/zip)
2016-03-05 08:29 UTC, Luke Kendall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kendall 2016-03-05 08:29:36 UTC
Created attachment 123310 [details]
Sample files to reproduce the problm

I pasted text and the associated comment from old-doc to new-doc, then began adding to (editing) the comment.
Then I wished to check that I had not (previously) changed the text in new-doc that the comment was attached to.  So I used Undo until the changes I'd just made were all gone; found that I had /not/ made any changes to the text, and then tried to Redo all the edits.  All changes except the two edits I'd made to the copied-comment "re-played".  (The changes were: deleting a leading blank line at the start of the comment, and then appending a newline and the text "[L]]" at the end of the comment.

While a minor problem, it seems indicative of a possibly-serious logic error, and thus worth reporting. I was able to reproduce it with the attached two tiny files.

Steps to reproduce:

1. Open both docs.
2. In "old", copy the text "black as pitch" and its associated comment.
3. Select the text "black as pitch" in the "new" doc, and paste to replace the text and add the comment.
4. Click into the comment in "new" and delete the empty blank line.
click to the end of the comment and Type <enter><enter>[L]<enter>
5. Undo all change to "new".
6. Redo until no further changes occur.

Result:
The edits made to the comment itself in "new" are not "replayed".
Comment 1 Buovjaga 2016-03-21 20:24:15 UTC
It said: The file 'Incomplete-Redo-new-doc.odt' is corrupt and therefore cannot be opened. 

It works for you?

64-bit, KDE Plasma 5
Build ID: 5.1.1.3 Arch Linux build-2
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 4bf2b6b2e6641c82e2b714e394482f1a1620b436
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 21st 2016
Comment 2 Luke Kendall 2016-03-21 23:58:19 UTC
Interesting.  I created the document in LO 5.1.0.3: the fact that the new doc is corrupt when seen by LO5.1.1.2 is interesting.

Yes, I experience the same behaviour you describe.

But if I allow LO to repair the document and proceed by following the steps I described in the original report, the same redo problem occurs.

I also checked that if I save the repaired Incomplete-Redo-new-doc.odt, close both docs and then follow the steps for the repaired doc and the old doc, the problem again is perfectly reproduced.

I don't still 5.1.0.3 installed, so I can't easily check to see what it thinks of Incomplete-Redo-new-doc.odt.

It seems very strange to me that a tiny document created by LO is seen as corrupt!

Do you think the nature of the corruption might be worth investigating, too? (Especially since the file is only 21 words long.)
Comment 3 Buovjaga 2016-03-22 17:41:16 UTC
Ok, going through the steps, when I redo, there does not appear a blank line before the comment text. First a blank comment appears and then the text appears without the blank line.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.2.0.0.alpha0+
Build ID: 011e65c93053c88eb752e50ef47c69872608cbcd
CPU Threads: 8; OS Version: Linux 4.4; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on March 22nd 2016
Comment 4 Luke Kendall 2016-03-23 00:59:29 UTC
So if I understand you correctly, you're confirming that the deletion of the blank line in the comment is not undone, nor is the new text (in this case, \n[L]\n\n) redone.
Comment 5 Buovjaga 2016-03-23 07:19:55 UTC
I was focusing on this: "Result:
The edits made to the comment itself in "new" are not "replayed"."
Comment 6 Oliver Specht (CIB) 2016-03-24 15:28:23 UTC
Undo/Redo in comments seems to work until the comment itself is removed

This works:
- change text in a comment 
- undo to the beginning of the change and redo 
      -> works

This fails:
-insert a comment, insert text into the comment
-undo all and redo 
     -> you get an empty comment

This fails - a bit simpler as in the initial description
-copy some text with an attached comment and paste it
-change something in the comment
-undo and redo 
    -> the comment appears as pasted, subsequent changes are gone
Comment 7 QA Administrators 2017-05-22 13:18:40 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2019-12-03 14:58:41 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2021-12-03 04:45:19 UTC Comment hidden (obsolete)
Comment 10 Luke Kendall 2021-12-03 07:46:08 UTC
Thanks, bug is now fixed.

Version: 7.2.3.2 / LibreOffice Community
Build ID: d166454616c1632304285822f9c83ce2e660fd92
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded