diff --git a/sw/qa/extras/ooxmlimport/data/indents.docx b/sw/qa/extras/ooxmlimport/data/indents.docx new file mode 100755 index 000000000000..b16736791c2e Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/indents.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index a32dd9006ec5..0f43ba9b7572 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -18,8 +18,6 @@ #include -#if !defined(WNT) - #include #include #include @@ -133,6 +131,8 @@ public: } }; +#if !defined(WNT) + DECLARE_SW_IMPORT_TEST(testMathMalformedXml, "math-malformed_xml.docx", FailTest) { CPPUNIT_ASSERT(!mxComponent.is()); @@ -2785,6 +2785,40 @@ DECLARE_OOXMLIMPORT_TEST(testTdf87924, "tdf87924.docx") #endif +DECLARE_OOXMLIMPORT_TEST(testIndents, "indents.docx") +{ + //expected left margin and first line indent values + static const sal_Int32 indents[] = + { + 0, 0, + -2000, 0, + -2000, 1000, + -1000, -1000, + 2000, -1000 + }; + uno::Reference textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(textDocument->getText(), uno::UNO_QUERY); + // list of paragraphs + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + size_t paraIndex = 0; + do + { + uno::Reference xServiceInfo; + if (xParaEnum->nextElement() >>= xServiceInfo) + { + uno::Reference const xPropertySet(xServiceInfo, uno::UNO_QUERY_THROW); + sal_Int32 nIndent = 0; + sal_Int32 nFirstLine = 0; + xPropertySet->getPropertyValue("ParaLeftMargin") >>= nIndent; + xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nFirstLine; + CPPUNIT_ASSERT_EQUAL(indents[paraIndex * 2], nIndent); + CPPUNIT_ASSERT_EQUAL(indents[paraIndex * 2 + 1], nFirstLine); + ++paraIndex; + } + } while (xParaEnum->hasMoreElements()); +} + + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx index 81d5bd02402a..b95883485544 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx @@ -624,7 +624,7 @@ string OOXMLHexValue::toString() const OOXMLUniversalMeasureValue::OOXMLUniversalMeasureValue(const char * pValue) { - mnValue = rtl_str_toUInt32(pValue, 10); // will ignore the trailing 'pt' + mnValue = rtl_str_toInt32(pValue, 10); // will ignore the trailing 'pt' int nLen = strlen(pValue); if (nLen > 2 &&