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

Miklos Vajna vmiklos at collabora.co.uk
Thu Nov 3 21:30:07 UTC 2016


 sw/qa/extras/ooxmlexport/data/tdf95031.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport7.cxx    |    7 +++++++
 writerfilter/source/dmapper/DomainMapper.cxx |    6 ++++++
 3 files changed, 13 insertions(+)

New commits:
commit 806e323271982c8975ec2904219c6f136aa20eea
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Oct 18 09:19:50 2016 +0200

    tdf#95031 DOCX import: auto spacing inside numbering means no spacing
    
    The WW8 import has code for this in SwWW8ImplReader::AppendTextNode(),
    with lots of corner-cases. Not all of that is implemented here yet, but
    the bullet list in the bugdoc already looks correct now.
    
    (cherry picked from commit c486e875de7c8e845594f5043a37ee8800865782)
    
    Conflicts:
    	sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
    
    Change-Id: I9499bfa4d8d7fcc425d7b95e64987258c099f7f2
    Reviewed-on: https://gerrit.libreoffice.org/30291
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf95031.docx b/sw/qa/extras/ooxmlexport/data/tdf95031.docx
new file mode 100644
index 0000000..ef082f7
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf95031.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index 42f6474..0e81597 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -1137,6 +1137,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom", "prst", "rect");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf95031, "tdf95031.docx")
+{
+    // This was 494, in-numbering paragraph's automating spacing was handled as visible spacing, while it should not.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(2), "ParaBottomMargin"));
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index af0ae0a..c39208b 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -613,6 +613,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
             }
             if  (nIntValue) // If auto spacing is set, then only store set value in InteropGrabBag
             {
+                if (m_pImpl->GetTopContext()->isSet(PROP_NUMBERING_RULES))
+                    // Numbering is set -> auto space is 0.
+                    default_spacing = 0;
                 m_pImpl->GetTopContext()->Insert( PROP_PARA_TOP_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ) );
             }
             else
@@ -635,6 +638,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
             }
             if  (nIntValue) // If auto spacing is set, then only store set value in InteropGrabBag
             {
+                if (m_pImpl->GetTopContext()->isSet(PROP_NUMBERING_RULES))
+                    // Numbering is set -> auto space is 0.
+                    default_spacing = 0;
                 m_pImpl->GetTopContext()->Insert( PROP_PARA_BOTTOM_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(default_spacing) ) );
             }
             else


More information about the Libreoffice-commits mailing list