Created attachment 139707 [details] Example file saved by Word 2013 If we create a document with a chart in a footnote in Word, and save it as DOCX, then reopen the file in LibreOffice, and save it again, it causes a broken file and Word is unable open it. Steps to reproduce: 1. Create a new document in Microsoft Word. 2. Create a short text with multiple footnotes. 3. Insert a chart in one of the footnotes. 4. Save the document as DOCX and close Word. 5. Open the file in LibreOffice, and save it again with a different filename as DOCX. 6. Attempt to open the file created with LibreOffice in Microsoft Word. Actual results: Charts multiply every time we save the file in Writer as DOCX and reopen it, and Microsoft Word is unable to open this DOCX file. Expected results: Charts shouldn't multiply, and Word should be able to open the file.
Created attachment 139708 [details] The example file exported by LO 5.4
Created attachment 139709 [details] Error message when trying to open the exported file
Repro 5.1 and 6.1+. With 5.0 chart wasn't seen on fileopen.
Fixed in the commit associated to Bug 115557.
I went back to the commit after the mentioned fix, and checked with a current version, but the result still doesn't open in Word for me. Unzipping the file reveals that 'word/embeddings/Microsoft_Excel_Worksheet1.xlsx' is missing from the archive, while it is referenced in 'word/charts/_rels/chart1.xml.rels', but there seem to be other issues as well, as copying this file over from the original and rezipping the archive doesn't work as a manual fix.
@Aron, I see your bug 170015 and confirm that one. But at that same point (in LO 7.2) the round-tripped document became openable in MS Word (tested 2024 and 2010). Yet in bug 170015 you say that you still see round-tripping problems using MS Word. I can't confirm. After round-tripping with both 7.2 and in 26.2/26.8, MS Word doesn't report any corruption opening the round-tripped file. The problem that you are seeing in 7.1 (if not fixed elsewhere) should be fixed by bug 143269.
(In reply to Justin L from comment #6) > @Aron, I see your bug 170015 and confirm that one. But at that same point > (in LO 7.2) the round-tripped document became openable in MS Word (tested > 2024 and 2010). Yet in bug 170015 you say that you still see round-tripping > problems using MS Word. I can't confirm. I forgot to add that I've been testing this on Windows, have you checked using a Windows build? I can still reproduce the issue with a ~week old build. > The problem that you are seeing in 7.1 (if not fixed elsewhere) should be > fixed by bug 143269. Which problem are you referring to? I can't find myself mentioning 7.1.
(In reply to Aron Budea from comment #7) > have you checked using a Windows build? No, I don't have easy access to Windows builds to check this. Puzzling that the OS would matter here...
At least part of the problem is related to substreams, footnote in this case. The code collects embeddings related to each stream in their own list (mxEmbeddingsList): https://github.com/LibreOffice/core/blob/ab6f22b162377272a7996402ea7b2e69f753af47/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx#L803 Then in the end the document's embedding list is added to the grabbag, but the footnote ones contain the reference to the XLSX. Looking at the code, transferring those from one place to the other isn't straightforward. A smaller problem is that in the footnote case, because there are 3 footnotes, the embedding reference is also stored 3 times, there should be a duplicate check. Roundtripping embedded XLSX files was implemented in bug 72520, but that doesn't handle the above case.
Aron Budea committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eeffa8b835ed8c734c5ee30f9b380c9db927d6ab tdf#115558 sw: export embedded XLSX in chart in footnote 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.
This is fixed, at least on Windows. On Linux it's affected by bug 170015 (perhaps by something else as well, hard to say), but at least the fix here should be general, and once the other issue is fixed, this is going to be OK on Linux, too. The test is disabled on Linux for now.
Aron Budea committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/c770439941e3eec2fe1a2599858b8dcefe178305 tdf#115558 sw: export embedded XLSX in chart in footnote It will be available in 26.2.3. 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.