From 3a44d7058dd7f7addf21d9292104d7eb73ec9716 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 14 Oct 2017 11:22:10 +0300 Subject: tdf#79272 ooxmlimport: support strict dxa tblWidth This patch is also required for tdf#78508. ECMA-376-1:2016 indicates that MeasurementOrPercent is a union of ST_DecimalNumberOrPercent and ST_UniversalMeasure. For the elements that use MeasurementOrPercent, that is represented as 1/50 of a percent or in Twips. This patch adds support for the ST_UniversalMeasure component of the union. Change-Id: I1bac30707f118a3d1f0eab3c27f8dcec96470592 Reviewed-on: https://gerrit.libreoffice.org/43384 Tested-by: Justin Luth Reviewed-by: Mike Kaganski Reviewed-by: Justin Luth --- sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx | Bin 0 -> 12279 bytes sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx b/sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx new file mode 100644 index 000000000000..4d5ea67bd8ea Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf79272_strictDxa.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 3587dbfd53a6..859baec2ab43 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -165,6 +165,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106970, "tdf106970.docx") CPPUNIT_ASSERT_EQUAL(static_cast(494), getProperty(getParagraph(4), "ParaBottomMargin")); } +DECLARE_OOXMLEXPORT_TEST(testTdf79272_strictDxa, "tdf79272_strictDxa.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4318), getProperty(xTables->getByIndex(0), "Width")); +} + DECLARE_OOXMLEXPORT_TEST(testKern, "kern.docx") { CPPUNIT_ASSERT(getProperty(getRun(getParagraph(1), 1), "CharAutoKerning")); -- cgit