sw/qa/extras/ooxmlexport/data/testParaListRightIndent.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 8 ++++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 ++++ 3 files changed, 12 insertions(+)
New commits: commit 42c5506a9e9ef58efd8193a193464e3b49d481ca Author: Vasily Melenchuk <vasily.melenc...@cib.de> AuthorDate: Mon Feb 7 14:31:02 2022 +0300 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed Feb 9 00:54:56 2022 +0100 docx import: right margin was not respected for para with list If paragpraph has list defined somewhere in styles and right margin defined in current style this margin was overriden with older value from parent styles. Change-Id: Ic0a2e9a1ce5f77b9ef38c549a62f1494c050982c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129595 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/qa/extras/ooxmlexport/data/testParaListRightIndent.docx b/sw/qa/extras/ooxmlexport/data/testParaListRightIndent.docx new file mode 100644 index 000000000000..975b598f476e Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/testParaListRightIndent.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index f3ed7d2127da..5de93edd3226 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -90,6 +90,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx") CPPUNIT_ASSERT_EQUAL(OUString("FF0000"), sColor); } +DECLARE_OOXMLEXPORT_TEST(testParaListRightIndent, "testParaListRightIndent.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), getProperty<sal_Int32>(getParagraph(1), "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5001), getProperty<sal_Int32>(getParagraph(2), "ParaRightMargin")); +} + CPPUNIT_TEST_FIXTURE(Test, testDontAddNewStyles) { // Given a document that lacks builtin styles, and addition of them is disabled: diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 99aefa3b1b09..a6694da7f3fa 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1745,6 +1745,10 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con if (nParaLeftMargin != 0) pParaContext->Insert(PROP_PARA_LEFT_MARGIN, uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false); + // Override right margin value with value from current style, if any + if (pStyleSheetProperties && pStyleSheetProperties->isSet(PROP_PARA_RIGHT_MARGIN)) + nParaRightMargin = pStyleSheetProperties->getProperty(PROP_PARA_RIGHT_MARGIN)->second.get<sal_Int32>(); + pParaContext->Insert(PROP_PARA_RIGHT_MARGIN, uno::makeAny(nParaRightMargin), /*bOverwrite=*/false); } }