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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jul 18 10:21:35 UTC 2018


 sw/qa/extras/ooxmlexport/data/margins_from_style.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx            |   17 +++++++++++++++++
 2 files changed, 17 insertions(+)

New commits:
commit 480ac84f2f5049fb4337b36f12fd6796e005761b
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Wed Jul 18 10:56:28 2018 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Wed Jul 18 12:21:14 2018 +0200

    tdf#118521 unit test for DOCX import: fix paragraph margin from style
    
    Change-Id: Ifa9d3803ab6440544a027bf35367e3c25faf1fd3
    Reviewed-on: https://gerrit.libreoffice.org/57620
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/data/margins_from_style.docx b/sw/qa/extras/ooxmlexport/data/margins_from_style.docx
new file mode 100644
index 000000000000..721982458e4f
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/margins_from_style.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 31a8a70989d8..034f252bad26 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -447,6 +447,23 @@ DECLARE_OOXMLEXPORT_TEST(testOpenDocumentAsReadOnly, "open-as-read-only.docx")
     CPPUNIT_ASSERT(pTextDoc->GetDocShell()->IsSecurityOptOpenReadOnly());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testMarginsFromStyle, "margins_from_style.docx")
+{
+    // tdf#118521 paragraphs with direct formatting of top or bottom margins have
+    // lost the other margin comes from paragraph style, getting a bad
+    // margin from the default style
+
+    // from direct formatting
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(35), getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin"));
+    // from paragraph style
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(106), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
+
+    // from paragraph style
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(388), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin"));
+    // from direct formatting
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(600), getProperty<sal_Int32>(getParagraph(3), "ParaBottomMargin"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list