Bug 104418 - FILESAVE DOCX: Malformed table with nested sub table when reopened in LO (better in MSO)
Summary: FILESAVE DOCX: Malformed table with nested sub table when reopened in LO (bet...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
4.2 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0
Keywords: filter:docx
Depends on:
Blocks: DOCX-Tables
  Show dependency treegraph
 
Reported: 2016-12-05 12:59 UTC by Telesto
Modified: 2021-11-24 22:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Minimized document (12.15 KB, application/vnd.oasis.opendocument.text)
2020-01-27 11:32 UTC, NISZ LibreOffice Team
Details
The minimized document saved to docx (12.87 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-01-27 11:32 UTC, NISZ LibreOffice Team
Details
Screenshot of the original and exported document (57.25 KB, image/png)
2020-01-27 11:38 UTC, NISZ LibreOffice Team
Details
Another reduced example document (13.14 KB, application/vnd.oasis.opendocument.text)
2020-01-27 12:20 UTC, NISZ LibreOffice Team
Details
The second example saved as docx (12.97 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-01-27 12:21 UTC, NISZ LibreOffice Team
Details
Screenshot of the second example file, also the exported docx in Writer and Word (77.69 KB, image/png)
2020-01-27 12:22 UTC, NISZ LibreOffice Team
Details
Screenshot of the second example document (92.09 KB, image/png)
2020-03-16 13:10 UTC, Gabor Kelemen (allotropia)
Details
The first example file in LO and docx version in Word and LO (221.50 KB, image/png)
2021-11-24 14:03 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2016-12-05 12:59:31 UTC
Description:
Table layout isn't looking right when opening the docx with LibreOffice. The export DOCX looks quite well in Word Viewer

Steps to Reproduce:
1.Open attachment 53758 [details] (bug 43150)
2.Save it as docx
3.Reopen the file with LO

Actual Results:  
Table is malformed
	


Expected Results:
Same as ODT


Reproducible: Always

User Profile Reset: YES

Additional Info:
Found in:
Version: 5.4.0.0.alpha0+
Build ID: 33f5bc54aaa7fe7aa9335726e30f9c349155e04d
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-12-01_23:21:05
Locale: nl-NL (nl_NL); Calc: CL

Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: en-US (nl_NL)

Can't be tested with 4.4.6.3 or below. 


User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Xisco Faulí 2016-12-05 16:06:21 UTC
Confirmed in

Version: 5.4.0.0.alpha0+
Build ID: 18b3138a7ac4da823e41640bed8a4707029b8fb0
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

and 

Version: 4.2.0.0.alpha1+
Build ID: fc8f44e82de4ebdd50ac5fbb9207cd1a59a927e3
Comment 2 QA Administrators 2017-12-08 08:07:00 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2019-12-11 03:38:20 UTC Comment hidden (obsolete)
Comment 4 Timur 2019-12-20 22:29:16 UTC
repro 6.5+ for wrong reopen in LO
Comment 5 NISZ LibreOffice Team 2020-01-27 11:32:10 UTC
Created attachment 157445 [details]
Minimized document

This is a minimized version of the document.

Originally it has at the top some cells that contain a nested sub table ( table:is-sub-table="true" is set in ODF xml). The first row has a fixed 1.5 cm height which is equally distributed to the two rows of the second column (these are the sub-table).

When this is exported to DOCX the first row in the second column gets 1.5 cm height instead of the original 0.75 cm.
Comment 6 NISZ LibreOffice Team 2020-01-27 11:32:41 UTC
Created attachment 157446 [details]
The minimized document saved to docx
Comment 7 NISZ LibreOffice Team 2020-01-27 11:38:24 UTC
Created attachment 157447 [details]
Screenshot of the original and exported document
Comment 8 NISZ LibreOffice Team 2020-01-27 12:20:36 UTC
Created attachment 157448 [details]
Another reduced example document

This is another example document reduced from the original.

Here the top row has different column widths than the bottom one.
Also it has the sub-table in the center column.

When this file is saved as docx the column widths go crazy in Writer with the first and last rows having equal widths. Also the second row of the sub-table becomes a new row.
In Word its looking better, with only the row height doubling in the A2 row (this is the same as the previous example file) and middle columns getting wider to fit the short text. Also some border pieces are missing above cell C3 and right of B2.
Comment 9 NISZ LibreOffice Team 2020-01-27 12:21:14 UTC
Created attachment 157449 [details]
The second example saved as docx
Comment 10 NISZ LibreOffice Team 2020-01-27 12:22:25 UTC
Created attachment 157450 [details]
Screenshot of the second example file, also the exported docx in Writer and Word
Comment 11 NISZ LibreOffice Team 2020-01-27 12:23:20 UTC
The example file of bug #107626 also contains table:is-sub-table="true" in the problematic table.
Comment 12 Gabor Kelemen (allotropia) 2020-03-16 13:10:26 UTC
Created attachment 158721 [details]
Screenshot of the second example document

Attachment #157448 [details] looks much better in: 

Version: 7.0.0.0.alpha0+
Build ID: 5a2c340e00050e21f29ae880593ef4f9ec1ba08d
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: hu-HU (hu_HU.UTF-8); UI-Language: en-US
Calc: threaded

The problem reported for attachment #157445 [details] remains.
Comment 13 Gabor Kelemen (allotropia) 2021-11-24 14:03:56 UTC
Created attachment 176470 [details]
The first example file in LO and docx version in Word and LO

attachment 157445 [details] (and the original document in comment #0 as well) seems to be fixed since

https://git.libreoffice.org/core/+/e366c928819c44b5c253c45dca6dae40b71c9808%5E%21/#F0

author	Michael Stahl <Michael.Stahl@cib.de>	Thu Oct 01 17:31:21 2020 +0200
committer	Michael Stahl <michael.stahl@cib.de>	Mon Oct 05 19:37:50 2020 +0200

sw: ODF import: convert the simplest sub-tables to rowspan tables
Comment 14 Gabor Kelemen (allotropia) 2021-11-24 14:11:15 UTC
Thanks Michael for fixing this one!
Comment 15 Commit Notification 2021-11-24 22:08:26 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6e0a512da826e2856e7d36200a878b64907816c8

tdf#104418: sw_ooxmlexport10: Add unittest

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.