Bug 165642 - FILESAVE DOCX: word/glossary missing endnotes.xml and footnotes.xml (MS Word error on open)
Summary: FILESAVE DOCX: word/glossary missing endnotes.xml and footnotes.xml (MS Word ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.8.0
Keywords: bibisected, bisected, filter:docx
Depends on:
Blocks: DOCX-Corrupted
  Show dependency treegraph
 
Reported: 2025-03-08 21:30 UTC by Justin L
Modified: 2025-03-08 23:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
T56739_min.docx: the example document (7.79 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-03-08 21:30 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-03-08 21:30:55 UTC
Created attachment 199697 [details]
T56739_min.docx: the example document

MS Word is complaining about invalid or missing content after this document is round-tripped by LO. (This issue can only be seen in MS Word.)

For this minimal document, a bibisect points to mk's 7.5 (backported to 7.4.4)
commit dda4867a0b5a2d29d8a01a3656e0c8dac7626d2f
Author: Mike Kaganski on Tue Nov 29 20:23:13 2022 +0300
    tdf#152289: implement external glossary relations roundtrip

The problem is that word/glossary/ contains settings.xml and its contents contains references to endnotePr and footnotePr, so endnotes.xml and footnotes.xml must also exist - but they weren't being round-tripped.

[On a larger example document, the excess glossary files were already being round-tripped before Mike's commit, so this is not really a regression.]

I don't know what (if any) purpose these files have, but based on Mike's unit test it seems "normal". So simply add some code to round-trip these two files as well - using Mike's commit as the template.

Proposed fix at https://gerrit.libreoffice.org/c/core/+/182674?usp=dashboard
Comment 1 Commit Notification 2025-03-08 23:47:17 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/60788682d3d62264e8a5ac42f3469f2d2f55815c

tdf#165642 docx export glossary: RT endnotes.xml/footnotes.xml too

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.