summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-06-08 11:55:18 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-06-09 07:46:34 +0200
commitea890b1d4bcd6dd59db9f52dce1609c020804e24 (patch)
treec3eb894389ae12d36d7815670c591e5cccffe9c0 /sw/qa/extras/ooxmlimport
parentfdfdea4d5af51a68f2d497cc5c3359d74c385fd5 (diff)
tdf#108408: support unit specifications for ST_HpsMeasure
w:ST_HpsMeasure is defined in ECMA-376 5th ed. Part 1, 17.18.42 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). This patch generalizes OOXMLUniversalMeasureValue to handle standard- defined units, and introduces two typedefed specifications: OOXMLTwipsMeasureValue (which is used where UniversalMeasure was previously used), and new OOXMLHpsMeasureValue. Unit test included. Change-Id: Iccc6d46f717cb618381baf89dfd3e4bbb844b4af Reviewed-on: https://gerrit.libreoffice.org/38562 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf108408.docxbin0 -> 1298 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx9
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf108408.docx b/sw/qa/extras/ooxmlimport/data/tdf108408.docx
new file mode 100644
index 000000000000..dcd1ecf8bd2e
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf108408.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 9c61378ae245..2d4804e937af 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1284,6 +1284,15 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108350, "tdf108350.docx")
CPPUNIT_ASSERT_EQUAL(double(11), getProperty<double>(xRun, "CharHeight"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf108408, "tdf108408.docx")
+{
+ // Font size must consider units specifications; previously ignored and only used
+ // integer part as half-pt size, i.e. 10 pt (20 half-pt) instead of 20 pt
+ uno::Reference<text::XTextRange> xPara(getParagraph(1));
+ uno::Reference<beans::XPropertySet> xRun(getRun(xPara, 1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(double(20), getProperty<double>(xRun, "CharHeight"));
+}
+
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT