Bug 135906 - FILESAVE: DOCX with SmartArt roundtripped in Writer fails to open in Word
Summary: FILESAVE: DOCX with SmartArt roundtripped in Writer fails to open in Word
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.4.2 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.3.0 target:7.2.5
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Corrupted OOXML-SmartArt
  Show dependency treegraph
 
Reported: 2020-08-19 08:27 UTC by Roman Kuznetsov
Modified: 2021-12-06 13:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
example DOCX (35.08 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-08-19 08:36 UTC, Roman Kuznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2020-08-19 08:27:44 UTC
Description:
Writer generates a wrong DOCX and MS Word can't open it

Steps to Reproduce:
1. Open the file from attach in LO 7
2. Save it as DOCX with another name
3. Try open a new DOCX in MS Word. You'll see a message with error and Word will not open the file

Actual Results:
MS Word can't open a DOCX file that LO made

Expected Results:
MS Word opens a DOCX file that LO made


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.1 (x64)
Build ID: 04ba7e3f1e51af6c5d653e543a620e36719083fd
Потоков ЦП: 4; ОС: Windows 10.0 Build 18362; Отрисовка ИП: по умолчанию; VCL: win
Locale: ru-RU (ru_RU); ИП: ru-RU
Calc: threaded
Comment 1 Roman Kuznetsov 2020-08-19 08:36:14 UTC
repro in 6.3 but not in 6.2 =>regression
Comment 2 Roman Kuznetsov 2020-08-19 08:36:46 UTC
Created attachment 164445 [details]
example DOCX
Comment 3 Aron Budea 2020-08-19 13:49:52 UTC
Confirmed with LO 7.1.0.0.alpha0+ daily build from 08-15 / Windows.
Comment 4 Roman Kuznetsov 2020-08-19 17:08:55 UTC
I bisected it and got bad commit aafaf1f55fa413ad49d4556cf7c0a713dd206ae4

https://gerrit.libreoffice.org/c/core/+/69598

CC: to Miklos Vajna and Grzegorz Araminowicz
Comment 5 Justin L 2021-11-17 09:57:08 UTC
LO also complains about this document being wrong.

The problem is in header1.xml.  After the final </w:hdr>

we have this extra stuff tacked on at the end.

<wp:docPr id="2" name="Diagram2"/><wp:cNvGraphicFramePr/><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/diagram"><dgm:relIds xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:dm="rId2" r:lo="rId3" r:qs="rId4" r:cs="rId5"/></a:graphicData></a:graphic>
Comment 6 Justin L 2021-11-18 10:32:03 UTC
oox's WriteDialog just writes to mpFS. writerfilter is not setting that FS before calling the function.

so
-    sax_fastparser::FSHelperPtr pFS = m_pImpl->getSerializer();
should have been replaced by
+    m_pImpl->getDrawingML()->SetFS(m_pImpl->getSerializer());

Proposed fix at http://gerrit.libreoffice.org/c/core/+/125441
Comment 7 Commit Notification 2021-11-19 08:13:42 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0afd2d3bfa9d55249ffd1408681ff04decf2d8fa

tdf#135906 docxexport: set serializer before writing

It will be available in 7.3.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 8 Commit Notification 2021-11-19 16:08:31 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/5853e4d137c3cb535571cba0233b05a48761ac52

tdf#135906 docxexport: set serializer before writing

It will be available in 7.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.
Comment 9 Christian Lohmaier 2021-12-06 13:28:48 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard