sw/qa/extras/ooxmlexport/data/tdf132752.docx      |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx        |    7 +++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    9 +++++++++
 3 files changed, 16 insertions(+)

New commits:
commit a3f2312a68f48e3ad07c643b8eba0f10bd2e81fc
Author:     Vasily Melenchuk <vasily.melenc...@cib.de>
AuthorDate: Wed May 19 13:58:35 2021 +0300
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Mon May 31 14:44:41 2021 +0200

    tdf#132752: docx import: improvements for first line indent in lists
    
    As far as I see, Word is using lists with id=0 and no list definitions
    to reset list numbering used in this paragraph. At the same time Word
    is still using some of default list properties. For example in this
    scenario parent style has defined first line indent, but in paragrath
    it is overwritten by "not existing" list=0 without definitions.
    
    To this moment I know about only first line indent behavior, but
    probably some other properties are also affected.
    
    Change-Id: I344c907bb7a7b83a91f5727e13ad184fb44137b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115795
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116221
    Tested-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf132752.docx 
b/sw/qa/extras/ooxmlexport/data/tdf132752.docx
new file mode 100644
index 000000000000..57eddc455fca
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf132752.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 18a22bbdd30c..e1fed0f145b3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -446,6 +446,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120394, "tdf120394.docx")
     }
 }
 
+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(testHyphenationAuto, "hyphenation.odt")
 {
     // Explicitly set hyphenation=auto on document level
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 329999ca18ce..be63df248946 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1400,6 +1400,15 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
 
         if ( pStyleSheetProperties->GetListLevel() >= 0 )
             pParaContext->Insert( PROP_NUMBERING_LEVEL, 
uno::makeAny(pStyleSheetProperties->GetListLevel()), 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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to