Bug 154478

Summary: Fileopen DOCX: Comments empty after ToC
Product: LibreOffice Reporter: Timur <timur>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: VERIFIED FIXED    
Severity: normal CC: aron.budea, buzea.bogdan, jluth, kelemeng, raal, thb
Priority: high Keywords: bibisected, bisected, regression
Version: 6.3.0.4 release   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=154481
https://bugs.documentfoundation.org/show_bug.cgi?id=148908
Whiteboard: target:7.6.0 target:7.5.4
Crash report or crash signature: Regression By: Thorsten Behrens
Bug Depends on:    
Bug Blocks: 112916    
Attachments: DOCX
printscreen from Word
screenshot

Description Timur 2023-03-30 13:48:55 UTC
Created attachment 186318 [details]
DOCX

Open attached DOCX. 
See that comments after ToC appear empty although they exist in MSO.

This is a regression from commit in 6.3:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=ff4f2ba3242d303f7f238a7a142440f1f4b1f288

author		Serge Krot <Serge.Krot@cib.de>	2018-12-06 19:11:58 +0100
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2019-01-09 22:30:08 +0100
sw: DOCX: recognize TOC title during import

I see that Serge is not active anymore so do not add. 

Note: DOCX also has wrong number of pages, I'll See Also that.
Comment 1 raal 2023-04-02 05:51:37 UTC
Created attachment 186402 [details]
printscreen from Word
Comment 2 raal 2023-04-02 05:52:00 UTC
Confirm with Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8e97ef854fb225dac37185c1911894b7d206fa8d
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 3 Timur 2023-04-17 10:54:32 UTC
With Attila's patch 94de79e7d3c980b576192d2f264bee658716163a in 7.6+, in LO comments remain empty on page 4 which is this bug (many more empty in the original document) but they appeared after grouped image (page 6 comment 5 and later).
Comment 4 Timur 2023-04-28 08:55:17 UTC
Proposed fix at https://gerrit.libreoffice.org/c/core/+/151103 says: 

TOC creation entered a malformed state where it interfered with
the creation of other elements (e.g. annotations and textboxes).
This change is also a fix to tdf#154481, so the patch from
94de79e7d3c98 can be removed.
Comment 5 Commit Notification 2023-05-03 10:43:34 UTC
Jaume Pujantell committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5431b756d45bebe74beaba2026704552ee6891f0

tdf#154478 fix comments empy after ToC

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 6 BogdanB 2023-05-03 15:57:53 UTC
Created attachment 187075 [details]
screenshot

Jaume Pujantell, you can mark the bug as resolved.

Verified with
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bb198176684c3d9377e26c04a29ec66deb811949
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

In the image is a screenshot before and after.
Before
Version: 7.5.2.1 (X86_64) / LibreOffice Community
Build ID: e8bf3b441b8370f8440b0339fd9490765a8d57ca
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

After
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bb198176684c3d9377e26c04a29ec66deb811949
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 7 BogdanB 2023-05-03 17:27:54 UTC
Verified with
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bb198176684c3d9377e26c04a29ec66deb811949
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 8 Commit Notification 2023-05-04 13:47:11 UTC
Jaume Pujantell committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#154478 fix comments empy after ToC

It will be available in 7.5.4.

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 9 Commit Notification 2023-05-04 15:28:27 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2711b42088ad8e19c2bccd265f032b4acaba7b9e

tdf#154478: sw_ooxmlexport18: Add unittest

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.