[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/qa writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Oct 1 02:20:11 PDT 2015


 sw/qa/extras/ooxmlimport/data/tdf93919.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx     |    6 ++++++
 writerfilter/source/dmapper/DomainMapper.cxx |    5 +++++
 3 files changed, 11 insertions(+)

New commits:
commit 950cfbd75a216527d850351e4b3e0be4f8870a7d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Sep 28 14:03:25 2015 +0200

    bnc#939996 tdf#93919 DOCX import: fix left-from-style and first-from-direct
    
    With this, <w:ind w:hanging="..."/> as direct paragraph formatting and
    <w:ind w:left="..." w:hanging="..."/> as a numbering level formatting is
    properly merged, i.e. w:left is not lost, defaulting to 0.
    
    (cherry picked from commit 56341e5d496f576dc45fe8e6c44831d780fecb73)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: If5534fbd9ee6d41139b0ed3a3df9d0cc5aad3239
    Reviewed-on: https://gerrit.libreoffice.org/18907
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf93919.docx b/sw/qa/extras/ooxmlimport/data/tdf93919.docx
new file mode 100644
index 0000000..c745469
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf93919.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 20cb6fe..fa8d504 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2641,6 +2641,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf87924, "tdf87924.docx")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aGeometry["TextPreRotateAngle"].get<sal_Int32>());
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf93919, "tdf93919.docx")
+{
+    // This was 0, left margin was not inherited from the list style.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index b0c6724..a56fbed 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -466,6 +466,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                 sal_Int32 nValue = ConversionHelper::convertTwipToMM100( nIntValue );
                 m_pImpl->GetTopContext()->Insert(
                     PROP_PARA_FIRST_LINE_INDENT, uno::makeAny( - nValue ));
+
+                // See above, need to inherit left margin from list style when first is set.
+                sal_Int32 nParaLeftMargin = m_pImpl->getCurrentNumberingProperty("IndentAt");
+                if (nParaLeftMargin != 0)
+                    m_pImpl->GetTopContext()->Insert(PROP_PARA_LEFT_MARGIN, uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false);
             }
             break;
         case NS_ooxml::LN_CT_Ind_firstLine:


More information about the Libreoffice-commits mailing list