Bug 108408 - DOCX IMPORT: support unit specification for ST_HpsMeasure
Summary: DOCX IMPORT: support unit specification for ST_HpsMeasure
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Mike Kaganski
Whiteboard: target:5.5.0
Keywords: filter:docx
Depends on:
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:

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

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 (§
> * The ST_UnsignedDecimalNumber simple type (§

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":


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:

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:
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