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 8d505b4140c8cd0b89f9981977f9a5024684104d
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 14:25: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>
    (cherry picked from commit 42c5506a9e9ef58efd8193a193464e3b49d481ca)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129617

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 962574d871b1..ec07a5a946f0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -79,6 +79,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 1a7fbfda6b9b..c7385a2f4103 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1744,6 +1744,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);
             }
         }

Reply via email to