Bug 108408 - DOCX IMPORT: support unit specification for ST_HpsMeasure
Summary: DOCX IMPORT: support unit specification for ST_HpsMeasure
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:5.5.0
Keywords: filter:docx
Depends on:
Blocks:
 
Reported: 2017-06-08 08:55 UTC by Mike Kaganski
Modified: 2017-07-11 09:58 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A test DOCX with text run font size 20 pt (1.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-06-08 08:55 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-06-08 08:55:05 UTC
Created attachment 133909 [details]
A test DOCX with text run font size 20 pt

The attached file is a sanitized and minimized real-world document.
It has a single text run with text size set to 20 pt. Currently it opens in LO with text size of 10 pt, i.e. half of defined size.

The size is given using this markup:
> <w:sz w:val="20pt" />

This is illegal in first OOXML schema edition (i.e. 2007), but legal in later editions.

The type of the w:sz element is w:ST_HpsMeasure, which in later editions of standard (e.g. ECMA-376 5th ed. Part 1, 17.18.42) is defined as

> This simple type specifies that its contents contain either:
> * A positive whole number, whose contents consist of a measurement in half-points (equivalent to
> 1/144th of an inch), or
> * A positive decimal number immediately followed by a unit identifier.
...
> This simple type is a union of the following types:
> * The ST_PositiveUniversalMeasure simple type (§22.9.2.12).
> * The ST_UnsignedDecimalNumber simple type (§22.9.2.16).

We currently ignore the units specifications, and simply convert the integer part as it's half-pt measurement.
Comment 1 Mike Kaganski 2017-06-08 08:59:35 UTC
A patch is submitted: https://gerrit.libreoffice.org/38562
Comment 2 Commit Notification 2017-06-09 05:47:28 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#108408: support unit specifications for ST_HpsMeasure

It will be available in 5.5.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 Cor Nouws 2017-07-11 09:58:12 UTC
checked in Version: 6.0.0.0.alpha0+
Build ID: 959be1b5a9cd522394dba9366686a1256588223b
CPU threads: 4; OS: Linux 4.10; UI render: GL; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-07-11_00:18:59
Locale: nl-NL (nl_NL.UTF-8); Calc: group

thanks!