Bug 111550 - DOCX IMPORT: Missing nested table in a specific document
Summary: DOCX IMPORT: Missing nested table in a specific document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.0.0
Keywords: filter:docx
Depends on:
Blocks:
 
Reported: 2017-08-09 07:14 UTC by Mike Kaganski
Modified: 2020-07-17 06:44 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Missing nested table (1.33 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-08-09 07:14 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2017-08-09 07:14:22 UTC
Created attachment 135337 [details]
Missing nested table

The attachment is sanitized and distilled minimal reproducer of a real user's problem with a document created by a third-party report-generating software.

The file opens in Word with a 1-column 2-row outer table that has a nested table in second row. That nested table has a single cell with two lines of text in it, with line break between lines:

[Table1:A2]
[Table2:A1]

When open in Writer, there's no nested table, and outer table's second row's cell contains text

[Table1:A2]

with line break after it.

The document is ill-formed OOXML, that contains <w:tbl> element as direct child of <w:p>, which is illegal, but accepted by Word. Furthermore, Word makes a funny trick here, moving the content of the outer <w:p> into the first cell of inner table.

The goal is to try to be bug-to-bug compatible with Word here.
Comment 1 Mike Kaganski 2017-08-09 07:24:02 UTC
A patch is in gerrit: https://gerrit.libreoffice.org/40909
Comment 2 Commit Notification 2017-08-10 04:20:00 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=67a61e54531801645d51ad89aac30064b8c4b4e8

tdf#111550: A workaround for out-of-order (in-paragraph) tbl on OOXML

It will be available in 6.0.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.