Bug Hunting Session
Bug 109306 - DOCX IMPORT: A table in a specific document has wrong width in Writer
Summary: DOCX IMPORT: A table in a specific document has wrong width in Writer
Status: VERIFIED 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: DOCX-Tables
  Show dependency treegraph
 
Reported: 2017-07-24 10:44 UTC by Mike Kaganski
Modified: 2017-10-18 05:09 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
A document with table width defined in % (instead of fiftieths of percent) (1.28 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-07-24 10:44 UTC, Mike Kaganski
Details
Compare MSO, LO before, LO 6.0+ (86.78 KB, image/png)
2017-07-25 09:13 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2017-07-24 10:44:31 UTC
Created attachment 134814 [details]
A document with table width defined in % (instead of fiftieths of percent)

The only table in the attached document is too narrow when imported to writer (it only has 2% relative width, instead of 100% it has in Word).

The problem is caused by ignoring the "%" unit specification in "w:w" attribute of "w:tblW" element. According to ECMA-376-1:2016, ST_MeasurementOrPercent (the type of "w:w" attribute) is allowed to have this specification (and then is expected to be a floating-point value). First edition of the standard (of 2006) only defined this attribute to contain int32 value (of fiftieths of percent when holding relative widths).
Comment 1 Mike Kaganski 2017-07-24 10:48:48 UTC
A patch: https://gerrit.libreoffice.org/40361
Comment 2 Commit Notification 2017-07-24 14:31:32 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8c7c72c8f8a1c8c09ee7cd4f413611c456f336b2

tdf#109306: consider percent unit specification for table sizes

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.
Comment 3 Timur 2017-07-25 09:13:43 UTC
Created attachment 134833 [details]
Compare MSO, LO before, LO 6.0+
Comment 4 Commit Notification 2017-10-18 05:09:07 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=246d18520f194a6ccfebe7108666b85d6a5af9fa

tdf#109306 ooxmlimport: consider table sizes < 10%

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.