Bug 166126 - DOCX edited with Writer moves comments in Word
Summary: DOCX edited with Writer moves comments in Word
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0 target:25.2.4
Keywords: bibisected, bisected, dataLoss, implementationError
Depends on:
Blocks:
 
Reported: 2025-04-10 13:09 UTC by Timur
Modified: 2025-04-29 11:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample DOCX (15.76 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-04-10 13:09 UTC, Timur
Details
Sample compared in LO and MSO (103.17 KB, image/jpeg)
2025-04-10 13:10 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2025-04-10 13:09:08 UTC
Created attachment 200275 [details]
Sample DOCX

Make DOCX in LO, then edit in MSO to add empty comments (cannot be added in LO).
Or use attached sample. 
Save as DOCX and reopen in MSO. 
See that some comments are shown in wrong position in Word, so dataLoss.
Comment 1 Timur 2025-04-10 13:10:32 UTC
Created attachment 200276 [details]
Sample compared in LO and MSO

Note that comment 4 changed position and points to wrong text. Also no 5.
Comment 2 Timur 2025-04-10 13:46:09 UTC
Started in 3.7 in range d59024b652ccfaf7247da113ec36788fe260de74..15af925c254f27046427de70a59011e2ac3d6bdb , few commits mention comments. 

https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=d59024b652..15af925c25
Comment 3 Timur 2025-04-10 13:53:07 UTC
Likely where because range was added there. So I set bisected and remove a regression.
implementationError is keyword which here means: inccomplete implementation for the case of empty comments.

commit 9370212be859ab828b67a486657ee399a6ff2dcd 
MSWordExportBase::GetBookmarks: COMMENTRANGE fieldmarks are not bookmarks

commit 2e6f9dff530f16db33c52ab289efe18f96f71bb0
MSWordExportBase::OutputTextNode: recognize COMMENTRANGE fieldmarks

commit 8c0a8d9db351fc05534d7552036889543f3a89d4 
writerfilter: read w:commentRangeStart and w:commentRangeEnd elements
Comment 4 Commit Notification 2025-04-11 06:19:42 UTC
Jaume Pujantell committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1dacb5512b23bd804bbbfc184755512c80a8c4fa

tdf#166126 sw: docx: add annotationRef on comments

It will be available in 25.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 5 Commit Notification 2025-04-11 19:09:06 UTC
Jaume Pujantell committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/4c534294a3e8af1f1dcde12034d8271dd8e5538b

tdf#166126 sw: docx: add annotationRef on comments

It will be available in 25.2.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.