[Libreoffice-commits] core.git: sw/qa writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 1 18:59:04 UTC 2018


 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx    |    3 ++-
 sw/qa/extras/rtfexport/rtfexport.cxx         |    8 ++++----
 writerfilter/source/dmapper/DomainMapper.cxx |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 58e266ae808dbf3e157b38eb2c8f24774131e0f8
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Wed Aug 1 16:44:00 2018 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Wed Aug 1 20:58:40 2018 +0200

    tdf#118949 don't set zero auto top margin in every first paragraph
    
    of sections, only in table cells.
    
    Partially revert of the commit 0307a62790b33ee0c02c2323a8f759e53e2035a4.
    
    Change-Id: I1daf1bc49ce1acf42a55857c1b6b92c7cbcb8e00
    Reviewed-on: https://gerrit.libreoffice.org/58431
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index b3551e52ae89..fca3263616b9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -1225,7 +1225,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354_2, "tdf104354-2.docx")
 
     // bottom margin is not auto spacing
     uno::Reference<text::XTextRange> xCell3(xTable->getCellByName("A3"), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell3->getText()), "ParaTopMargin"));
+    // FIXME next top margin will be 0 after fixing this, too
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(1, xCell3->getText()), "ParaTopMargin"));
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(847), getProperty<sal_Int32>(getParagraphOfText(1, xCell3->getText()), "ParaBottomMargin"));
 
     // auto spacing, if the paragraph contains footnotes
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 5ebaa354112b..78a2c77a9e80 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -982,8 +982,8 @@ DECLARE_RTFEXPORT_TEST(testNumOverrideStart, "num-override-start.rtf")
 DECLARE_RTFEXPORT_TEST(testFdo82006, "fdo82006.rtf")
 {
     // These were 176 (100 twips), as \sbauto and \sbbefore were ignored.
-    // Exception: first paragraph gets zero top margin, see also tdf#104354.
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(0)),
+    // FIXME Exception: first paragraph gets zero top margin, see tdf#118533.
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)),
                          getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin"));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)),
                          getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
@@ -1425,8 +1425,8 @@ DECLARE_RTFEXPORT_TEST(testTdf112507, "tdf112507.rtf")
 DECLARE_RTFEXPORT_TEST(testTdf107480, "tdf107480.rtf")
 {
     // These were 176 (100 twips), as \htmautsp was parsed too late.
-    // Exception: first paragraph gets zero top margin, see also tdf#104354.
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(0)),
+    // FIXME Exception: first paragraph gets zero top margin, see tdf#118533.
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)),
                          getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin"));
     CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)),
                          getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 45ae707e3b46..36baed7489ce 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -655,8 +655,8 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                     default_spacing = 49;
                 else
                 {
-                    // tdf#104354, tdf#118533 first paragraph of sections and shapes got zero top margin
-                    if ((m_pImpl->GetIsFirstParagraphInSection() && !m_pImpl->IsInShape()) ||
+                    // tdf#104354 first paragraphs of table cells and shapes get zero top margin
+                    if ((m_pImpl->GetIsFirstParagraphInSection() && !m_pImpl->IsInShape() && m_pImpl->m_nTableDepth > 0) ||
                          m_pImpl->GetIsFirstParagraphInShape())
                         default_spacing = 0;
                     else


More information about the Libreoffice-commits mailing list