Bug 153526 - No Numbering/New Line After Comment
Summary: No Numbering/New Line After Comment
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.3 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.6.0 target:7.5.2
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: Writer-Comments
  Show dependency treegraph
 
Reported: 2023-02-10 14:01 UTC by Aidan Franits
Modified: 2023-06-21 03:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The formatting change. (71.78 KB, image/png)
2023-02-10 14:01 UTC, Aidan Franits
Details
File with no comment (8.16 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-02-11 14:42 UTC, Aidan Franits
Details
Same file with a comment (9.05 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-02-11 14:42 UTC, Aidan Franits
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aidan Franits 2023-02-10 14:01:00 UTC
Created attachment 185293 [details]
The formatting change.

On both my home (Linux) and work (Windows) computer, adding a comment to a document causes virtually all numbering, new lines, and spacing rules to reset in the lines afterwards. The same bug is present in files saved in an older version of LibreOffice or Microsoft Word. The documents look completely normal in Word, however.
Comment 1 Sophie Sipasseuth 2023-02-10 14:26:34 UTC
What do you mean by afterward?

In the current state of my understanding, I cannot reproduce the bug on my computer.

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 2 Aidan Franits 2023-02-10 14:35:37 UTC
(In reply to Sophie Sipasseuth from comment #1)
> What do you mean by afterward?
> 
> In the current state of my understanding, I cannot reproduce the bug on my
> computer.
> 
> Version: 7.5.0.3 (X86_64) / LibreOffice Community
> Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
> CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL:
> win
> Locale: fr-FR (fr_FR); UI: fr-FR
> Calc: CL threaded

I mean any text below the comment.

So to reproduce the bug, create a few lines of text with newlines, as if you were writing a numbered list. Add a comment to one of the text bodies in the middle; then save, close, and reopen Writer. You won't see any newlines or numbers below that comment.
Comment 3 Aidan Franits 2023-02-10 16:50:00 UTC
Update: Rendering is correct when the file is saved as ODT. Just not DOCX.
Comment 4 raal 2023-02-11 12:08:32 UTC
No repro with Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b052ec2f2fbe0f3044ba824c064a280a5ee9cd7f
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

Can you prepare test file without comments? Then I should insert comment, save, and see loosing the numbering.
Comment 5 Aidan Franits 2023-02-11 14:42:04 UTC
Created attachment 185318 [details]
File with no comment

Here is an outline that I regularly use and add comments to for work.
Comment 6 Aidan Franits 2023-02-11 14:42:56 UTC
Created attachment 185319 [details]
Same file with a comment

Here is the same file with a comment. You should see the bug in Writer 7.5, but not Microsoft Word.
Comment 7 QA Administrators 2023-02-12 03:21:15 UTC Comment hidden (obsolete)
Comment 8 raal 2023-02-21 23:31:24 UTC
confirm with Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 14844d835cc5d6dfde499a0b1074aea5dcff4fc7
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

works in Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 9 raal 2023-02-21 23:46:28 UTC
This seems to have begun at the below commit.
Adding Cc: to Justin Luth ; Could you possibly take a look at this one?
Thanks
 35908e41a2428fe1c4130c34ae4062c3f0705215 is the first bad commit
commit 35908e41a2428fe1c4130c34ae4062c3f0705215
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Mon Jul 11 22:14:26 2022 +0200

    source cf02b94bc513ee1b742b4c5d7174632b568e8b72

https://git.libreoffice.org/core/+/cf02b94bc513ee1b742b4c5d7174632b568e8b72
Comment 10 Justin L 2023-02-22 02:56:36 UTC
OK - this is absolutely bizarre. When we have a ParaStyleName property assigned to a comment, it raises an exception. But if I remove the property, then we get this problem. It will be interesting trying to find the root of all this...

So, the problem in my commit comes from avoiding inserting an illegal property into the top context in the case of IsInComments in lcl_startParagraphGroup.

So what? Things don't work unless an exception handler is run?
Comment 11 Justin L 2023-02-22 16:25:55 UTC
I see. The original exception prevented m_xPreviousParagraph from being changed.

Now we run into another exception trying to read NumberingRules from an editeng component which gives an exception because there is no mpEditSource->GetTextForwarder(), even though it does report hasPropertyByName.
Comment 12 Commit Notification 2023-02-22 22:36:00 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/dbbfcb7e098c1c16f932785ef62ef7d3d819ad1a

tdf#153526 writerfilter: catch exception from no NumberingRules

It will be available in 7.6.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.
Comment 13 Commit Notification 2023-02-23 07:35:56 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/bf9e8ce3a810e2989fb0b486b3398d523f69da97

tdf#153526 writerfilter: catch exception from no NumberingRules

It will be available in 7.5.2.

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.
Comment 14 lilycoliins 2023-06-21 03:51:59 UTC Comment hidden (no-value, spam)