summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-10-14 12:30:43 +0300
committerJustin Luth <justin_luth@sil.org>2017-10-18 07:07:57 +0200
commit246d18520f194a6ccfebe7108666b85d6a5af9fa (patch)
tree8d954cebc5bf24098a6d8f867df4f357e5e4160b
parenta4a182e24d2e3e954831a0a7c70a7299f28950cb (diff)
tdf#109306 ooxmlimport: consider table sizes < 10%
Change-Id: I336d5a498f4f4523e03b1316b7adaca21df4de82 Reviewed-on: https://gerrit.libreoffice.org/43385 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf109306.docxbin0 -> 1427 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx13
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf109306.docxbin1343 -> 0 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx13
-rw-r--r--writerfilter/source/ooxml/OOXMLPropertySet.cxx2
5 files changed, 14 insertions, 14 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf109306.docx
Binary files 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
--- a/sw/qa/extras/ooxmlimport/data/tdf109306.docx
+++ /dev/null
Binary files 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);