Bug 170457 - FILESAVE DOCX: commentReference to r:id not in comments.xml - and wrong start/end positions
Summary: FILESAVE DOCX: commentReference to r:id not in comments.xml - and wrong start...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:26.8.0 target:26.2.1
Keywords: bisected, filter:docx
Depends on:
Blocks: DOCX-Corrupted DOCX-Comments
  Show dependency treegraph
 
Reported: 2026-01-23 16:10 UTC by Justin L
Modified: 2026-01-26 16:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
ooo120405-1.docx: at least 5 of the 55 comments exhibit a problem (26.07 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-01-23 16:10 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2026-01-23 16:10:56 UTC
Created attachment 205157 [details]
ooo120405-1.docx: at least 5 of the 55 comments exhibit a problem

MS Word was reporting files as corrupt after they were round-tripped by LO.

Steps to reproduce:
-open ooo120405-1.docx in LO and save as DOCX
-try to open the round-tripped file in Microsoft Word

MS Word complains about something wrong with the comments.

This particular document was bisected to LO 4.3 with an editeng:sal_Bool->bool commit, but that just exposed an existing problem (somehow).

This particular document has about 55 comments, but the highest r:id was 60, so some numbers were skipped. Yet, document.xml referenced all 60 comments, and thus we have a corrupt situation where a commentReference points to a non-existent comment.
Comment 1 Commit Notification 2026-01-23 21:38:51 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#170457 docx export: only export comment start/end for this node

It will be available in 26.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.
Comment 2 Commit Notification 2026-01-26 16:57:17 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

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

tdf#170457 docx export: only export comment start/end for this node

It will be available in 26.2.1.

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.