Open attachment 96041 [details] from bug 76356 (in other name, fdo76356-1.docx), a DOCX, save it back to DOCX format, and try opening it in Word. => Word can't open the file cleanly. If one: - unzips the saved DOCX, - executes the following command (can be done in Linux/Cygwin, needs xmllint installed): find . \( -name "*.xml" -o -name "*.rels" \) -type f -exec xmllint --output '{}' --format '{}' \; - rezips the files with DOCX extension, Word points to line 37 in word/document.xml, which is this line: <w:footerReference w:type="first" r:id="rId7"/> (rId7 refers to footer3.xml) Observed with LO 26.2.0.0.alpha0+ (8ea8e254a3151f5390f3a10ff156fcaf8e7c5d5c), 7.2.0.4 / Windows. This is a regression/implementation error from the following commit in 7.2, before that only a single header/footer XML was exported: author Daniel Arato (NISZ) <arato.daniel@nisz.hu> Fri Feb 05 12:07:48 2021 +0100 committer László Németh <nemeth@numbertext.org> Tue May 04 19:14:22 2021 +0200 tdf#69635 DOCX: export hidden (shared) headers/footers
The problem here seems to be that both chart1 and chart2 refer to the exact same ../embedding file. Although one would think that is exactly what the point of having these things be as separate entries, apparently that is not good? (So I tried this in Word 2024 - I copied the OLE footer object into a "first page" - just like the RT does. It did indeed create two identical embeddings...) In any case, I could manually solve this by copying to 'Microsoft_Excel_Macro-Enabled_Worksheet2.xlsm', then pointing to this file in charts/_rels, and adding a corresponding entry to [Content Types].xml
AFAICS, we only round-trip OOEmbeddings. On import, we seem to look to see if they are actually referenced, and if so, then we dump them into UNO_NAME_MISC_OBJ_INTEROPGRABBAG, and at export time we just WriteEmbeddings and simply dump them out again. So then the key seems to be to simply avoid creating a <c:externalData> when we duplicate a chart
*** Bug 169198 has been marked as a duplicate of this bug. ***
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/81a1539bf2e197de1275af762b26e98652551a8a tdf#168977 docx export: prevent multiple chart rels to embeddings/file 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.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/19a96b19444a69cb36251e682c87322b1169a98f tdf#168977 docx export: prevent multiple chart rels to embeddings/file It will be available in 26.2.0.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.