diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf132752.docx | bin | 0 -> 34704 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 |
3 files changed, 17 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf132752.docx b/sw/qa/extras/ooxmlexport/data/tdf132752.docx Binary files differnew file mode 100644 index 000000000000..57eddc455fca --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132752.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index 33d7bffa7ed6..0b3f2321c4c6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -46,6 +46,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, "tdf138892_noNumbering.docx" CPPUNIT_ASSERT_MESSAGE("Para3: <blank line>", getProperty<OUString>(getParagraph(3), "NumberingStyleName").isEmpty()); } +DECLARE_OOXMLEXPORT_TEST(testTdf132752, "tdf132752.docx") +{ + CPPUNIT_ASSERT_EQUAL(sal_Int32(1801), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(getParagraph(1), "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf140668, "tdf140668.docx") { // Don't crash when document is opened diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index d3c779a10b6c..0d008bf78618 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1537,6 +1537,15 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con pParaContext->Insert(PROP_PARA_LEFT_MARGIN, uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false); } } + + if (nListId == 0 && !pList) + { + // Seems situation with listid=0 and missing list definition is used by MS Word + // to remove numbering defined previously. But some default numbering attributes + // are still applied. This is first line indent, probably something more? + if (!pParaContext->isSet(PROP_PARA_FIRST_LINE_INDENT)) + pParaContext->Insert(PROP_PARA_FIRST_LINE_INDENT, uno::makeAny(sal_Int16(0)), false); + } } // apply AutoSpacing: it has priority over all other margin settings @@ -1996,7 +2005,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con const bool bLeftSet = pParaContext->isSet(PROP_PARA_LEFT_MARGIN); const bool bRightSet = pParaContext->isSet(PROP_PARA_RIGHT_MARGIN); const bool bFirstSet = pParaContext->isSet(PROP_PARA_FIRST_LINE_INDENT); - if ( bLeftSet != bRightSet || bRightSet != bFirstSet ) + if (bLeftSet != bRightSet || bRightSet != bFirstSet) { if ( !bLeftSet ) { |