Bug 106001 - Text in DOCX appears condensed in Writer
Summary: Text in DOCX appears condensed in Writer
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.0.4 release
Hardware: All All
: medium normal
Assignee: Aron Budea
QA Contact:
URL:
Whiteboard: interoperability target:5.4.0 target:...
Keywords: filter:docx
Depends on:
Blocks: DOCX
  Show dependency treegraph
 
Reported: 2017-02-14 12:47 UTC by Aron Budea
Modified: 2017-03-24 13:43 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document (32.66 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-14 12:47 UTC, Aron Budea
Details
comparison MSO 2010 and LibreOffice 5.4 (12.12 KB, image/png)
2017-02-14 15:47 UTC, Xisco Faulí
Details
Test document fixed by MS Word for Mac (35.63 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-16 16:41 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-02-14 12:47:33 UTC
Created attachment 131205 [details]
Test document

The attached DOCX document, consisting of a single paragraph as a list item opens and looks fine in Word, but the text appears condensed in Writer (5.3.0.3, 3.6.0.4 / Windows 7).

The cause is this XML tag in word/document.xml: <w:w w:val="0"/>
If the document is decompressed, the tag is removed in a text editor (from line 94 and others), and the files are recompressed, the document shows fine in Writer as well.
Another way to fix the look is to select the condensed text, open Format -> Character..., and on Position tab change Scale width from 1% to 100%.

The file was coming from Word, and reduced/sanitized by cutting parts of the XML and replacing text/images. Other parts looked fine in Writer, and didn't include the mentioned tag. No XML code related to the remaining part has been changed or cut.
Comment 1 Xisco Faulí 2017-02-14 15:47:08 UTC
Confirmed in

Version: 5.4.0.0.alpha0+
Build ID: 880033edde516fc30225005245253293a6a58ba4
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 2 Xisco Faulí 2017-02-14 15:47:29 UTC
Created attachment 131208 [details]
comparison MSO 2010 and LibreOffice 5.4
Comment 4 Bartosz 2017-02-16 16:41:01 UTC
Created attachment 131281 [details]
Test document fixed by MS Word for Mac
Comment 5 Aron Budea 2017-02-16 16:56:50 UTC
Bartosz, how far are you with this? I have a fix almost ready to be submitted, my bad for not picking it up earlier.
Comment 6 Aron Budea 2017-02-16 21:42:01 UTC
Since there was no reply, I submitted my changes:
https://gerrit.libreoffice.org/34341
Comment 7 Commit Notification 2017-02-17 08:33:59 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6e3a84023b46f6be632b43d2f5713d8d4bb2ba62

tdf#106001: Treat CharScaleWidth outliers as 100 in DOCX import

It will be available in 5.4.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 8 Aron Budea 2017-02-17 12:40:17 UTC
Backports are on the way.
Comment 9 Commit Notification 2017-02-21 16:29:40 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=06c81a3e61e2d5743ffd8a50d85e5ecee989e46b&h=libreoffice-5-3

tdf#106001: Treat CharScaleWidth outliers as 100 in DOCX import

It will be available in 5.3.2.

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 2017-03-01 07:44:33 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "master":

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

tdf#106001: Clamp CharScaleWidth outliers when exporting to DOCX

It will be available in 5.4.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 11 Commit Notification 2017-03-18 13:32:04 UTC
Aron Budea committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e35f5ceefd586f03ace4cb3909bf5dd46007f49b&h=libreoffice-5-3

tdf#106001: Clamp CharScaleWidth outliers when exporting to DOCX

It will be available in 5.3.3.

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 Timur 2017-03-24 13:43:01 UTC
Congrats. Verified.
(In reply to Aron Budea from comment #8)
> Backports are on the way.
Backport for 5.2.7?