Bug 99090 - Exported DOCX cannot be opened by Word 2013
Summary: Exported DOCX cannot be opened by Word 2013
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:5.3.0 target:5.1.5 target:5.2.1
Keywords: filter:docx
Depends on:
Blocks:
 
Reported: 2016-04-05 01:26 UTC by Dave Levitt
Modified: 2017-10-22 09:12 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sanitized ODT source document (60.44 KB, application/vnd.oasis.opendocument.text)
2016-04-05 14:28 UTC, Dave Levitt
Details
Exported DOCX from sanitized sample (98.80 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-04-05 14:32 UTC, Dave Levitt
Details
Shorter example (9.18 KB, application/vnd.oasis.opendocument.text)
2016-04-12 12:10 UTC, Oliver Specht (CIB)
Details
another example document (14.38 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-06-28 14:06 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Levitt 2016-04-05 01:26:01 UTC
File created with LO cannot be opened with either Word 2013 [Windows 7] or Apple Pages [OSX 10.11.4]

LibreOffice as no trouble opening either the original ODT or the exported DOCX

As a work-around, I was able to export the document to .DOC format, and that export opened without complaint.

This issue may duplicate Bug 95546

I'm going to attempt to generate a short example document - it may be tied to an 'ole' style included object. [Visio document, the LO draw did not open with fidelity to the original]
Comment 1 raal 2016-04-05 12:25:17 UTC Comment hidden (obsolete)
Comment 2 Dave Levitt 2016-04-05 14:28:05 UTC
Created attachment 124091 [details]
Sanitized ODT source document

Sanitized version of source document [embedded Visio file same as original]
Comment 3 Dave Levitt 2016-04-05 14:32:52 UTC
Created attachment 124093 [details]
Exported DOCX from sanitized sample

This document was exported using LO on OSX [where Pages refused to open it]

On Win 7, Word 2013 refused to open it
[Details; Unspecified Error; Location: Part: /word/document.xml, Line 2, Column 0]

LO on Win 7 opened it - visually identical to the Mac
Comment 4 steve -_- 2016-04-08 07:54:41 UTC
OSX 10.11.4  + Word 15 complaining about an "unspecified error" and will not open docx test file. LO opens the file → new.
Comment 5 Oliver Specht (CIB) 2016-04-12 12:10:02 UTC
Created attachment 124278 [details]
Shorter example

If a table is followed by a paragraph with "page break before" the export creates something like:

</w:tbl>
<w:r><w:br w:type="page"/></w:r>
<w:p><w:pPr><w:pStyle w:val="Heading1"/>

This <w:r></w:r> without a paragraph around it is not allowed.
Comment 6 Oliver Specht (CIB) 2016-04-12 13:48:37 UTC
The code that writes the run outside of a paragraph came in with 

c916152d8562cab868d4c522748ac30029fad179
Author: Miklos Vajna <vmiklos@collabora.co.uk>
Date:   Mon Sep 21 07:31:33 2015 +0200

    tdf#92521 DOCX export: handle section break right after a table
Comment 7 Justin L 2016-06-28 14:06:21 UTC
Created attachment 125966 [details]
another example document

An interesting workaround is to open the corrupt document in LO and save it again.  The second time it opens in Word.

Another workaround (in MSWord) is to replace the PageBreak with a SectionPageBreak.

The examples open just fine in WordPad.  Confirmed that they are reported as corrupt in Word 2003 and 2013.
Comment 8 Justin L 2016-06-29 15:49:49 UTC
proposed fix: https://gerrit.libreoffice.org/#/c/26771/
Comment 9 Commit Notification 2016-07-11 07:31:44 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=07fb94655f4745eb4e80bf6e8d4cdd95371f23bb

tdf#99090 docx export page-break only inside a paragraph

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2016-07-12 19:20:31 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=28ded9c98837d6b6eefff73f396353b61b6b4017&h=libreoffice-5-1

tdf#99090 docx export page-break only inside a paragraph

It will be available in 5.1.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2016-07-14 08:15:59 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=620c00bf2279ccedf3fadefecc68186e25827b59&h=libreoffice-5-2

tdf#99090 docx export page-break only inside a paragraph

It will be available in 5.2.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Justin L 2016-07-18 12:19:21 UTC
This is not a duplicate of bug 95546