Bug 106001

Summary: Text in DOCX appears condensed in Writer
Product: LibreOffice Reporter: Aron Budea <aron.budea>
Component: WriterAssignee: Aron Budea <aron.budea>
Status: VERIFIED FIXED    
Severity: normal CC: gang65, timur, xiscofauli
Priority: medium Keywords: filter:docx
Version: 3.6.0.4 release   
Hardware: All   
OS: All   
Whiteboard: interoperability target:5.4.0 target:5.3.2 target:5.3.3
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 104520    
Attachments: Test document
comparison MSO 2010 and LibreOffice 5.4
Test document fixed by MS Word for Mac

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?