dev/null |binary sw/qa/extras/ooxmlexport/data/tdf109306.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 13 +++++++++++++ sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 13 ------------- writerfilter/source/ooxml/OOXMLPropertySet.cxx | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-)
New commits: commit 246d18520f194a6ccfebe7108666b85d6a5af9fa Author: Justin Luth <justin_l...@sil.org> Date: Sat Oct 14 12:30:43 2017 +0300 tdf#109306 ooxmlimport: consider table sizes < 10% Change-Id: I336d5a498f4f4523e03b1316b7adaca21df4de82 Reviewed-on: https://gerrit.libreoffice.org/43385 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf109306.docx b/sw/qa/extras/ooxmlexport/data/tdf109306.docx new file mode 100644 index 000000000000..d46049f83b53 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf109306.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 859baec2ab43..6ca5705eb4a0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -172,6 +172,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf79272_strictDxa, "tdf79272_strictDxa.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(4318), getProperty<sal_Int32>(xTables->getByIndex(0), "Width")); } +DECLARE_OOXMLEXPORT_TEST(testTdf109306, "tdf109306.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // Both types of relative width specification (pct): simple integers (in fiftieths of percent) + // and floats with "%" unit specification must be treated correctly + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(9), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth")); + + CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(1), "IsWidthRelative")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(80), getProperty<sal_Int16>(xTables->getByIndex(1), "RelativeWidth")); +} + DECLARE_OOXMLEXPORT_TEST(testKern, "kern.docx") { CPPUNIT_ASSERT(getProperty<bool>(getRun(getParagraph(1), 1), "CharAutoKerning")); diff --git a/sw/qa/extras/ooxmlimport/data/tdf109306.docx b/sw/qa/extras/ooxmlimport/data/tdf109306.docx deleted file mode 100644 index c13f0d6fd8e5..000000000000 Binary files a/sw/qa/extras/ooxmlimport/data/tdf109306.docx and /dev/null differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 050f8d27dfa8..a47b4e80290f 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1427,19 +1427,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf108849, "tdf108849.docx") CPPUNIT_ASSERT_EQUAL_MESSAGE("Misplaced body-level sectPr's create extra sections!", 2, getPages()); } -DECLARE_OOXMLIMPORT_TEST(testTdf109306, "tdf109306.docx") -{ - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); - // Both types of relative width specification (pct): simple integers (in fiftieths of percent) - // and floats with "%" unit specification must be treated correctly - CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(0), "IsWidthRelative")); - CPPUNIT_ASSERT_EQUAL(sal_Int16(90), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth")); - - CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTables->getByIndex(1), "IsWidthRelative")); - CPPUNIT_ASSERT_EQUAL(sal_Int16(80), getProperty<sal_Int16>(xTables->getByIndex(1), "RelativeWidth")); -} - DECLARE_OOXMLIMPORT_TEST(testTdf109524, "tdf109524.docx") { uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx b/writerfilter/source/ooxml/OOXMLPropertySet.cxx index 004e16f2eb6b..286da4fb040e 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx @@ -643,7 +643,7 @@ OOXMLMeasurementOrPercentValue::OOXMLMeasurementOrPercentValue(const char * pVal double val = rtl_str_toDouble(pValue); // will ignore the trailing unit int nLen = strlen(pValue); - if (nLen > 2 && + if (nLen > 1 && pValue[nLen - 1] == '%') { mnValue = static_cast<int>(val * 50); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits