Kaydet (Commit) 3a44d705 authored tarafından Justin Luth's avatar Justin Luth

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/43384Tested-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
üst f61acf7e
...@@ -165,6 +165,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106970, "tdf106970.docx") ...@@ -165,6 +165,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106970, "tdf106970.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(4), "ParaBottomMargin")); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(4), "ParaBottomMargin"));
} }
DECLARE_OOXMLEXPORT_TEST(testTdf79272_strictDxa, "tdf79272_strictDxa.docx")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(4318), getProperty<sal_Int32>(xTables->getByIndex(0), "Width"));
}
DECLARE_OOXMLEXPORT_TEST(testKern, "kern.docx") DECLARE_OOXMLEXPORT_TEST(testKern, "kern.docx")
{ {
CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(1), 1), "CharAutoKerning")); CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(1), 1), "CharAutoKerning"));
......
...@@ -650,11 +650,7 @@ OOXMLMeasurementOrPercentValue::OOXMLMeasurementOrPercentValue(const char * pVal ...@@ -650,11 +650,7 @@ OOXMLMeasurementOrPercentValue::OOXMLMeasurementOrPercentValue(const char * pVal
} }
else else
{ {
// TODO: also allow units. For that, we need to know mnValue = OOXMLTwipsMeasureValue(pValue).getInt();
// how to represent the number to converter or store
// the value in the type as number + unit and have
// getter with unit specification
mnValue = static_cast<int>(val);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment