summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-05-11 16:36:01 +0200
committerLászló Németh <nemeth@numbertext.org>2020-05-12 11:16:24 +0200
commit99b2d53346d4b01b491cd1f7fae3304ac0572e12 (patch)
tree9b3aa9c533aeab8d9b82925b8fa613e518440fdc /sw
parentf5636817e7677a3081263df9004940a7d5ac54af (diff)
tdf#132802 DOCX import: fix list bottom auto margins
of the last list item, when its numbering based on the paragraph style. Before tables, table rows and before paragraphs without numbering or with different numbering list items got a regression from commit 9a132c8fab7d4d70b91e5ed92429c70a0466afcb (tdf#122342 DOCX import: fix bottom auto margin in lists) Change-Id: I23c73d94569e785ec780d708d983764534e356c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93973 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf132802.docxbin0 -> 12960 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx19
2 files changed, 18 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf132802.docx b/sw/qa/extras/ooxmlexport/data/tdf132802.docx
new file mode 100644
index 000000000000..c4c2d9a1e268
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf132802.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 4227765975de..88e081898622 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -188,7 +188,24 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122342, "tdf122342.docx")
// TODO fix for ParaTopMargin, too.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin"));
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), "ParaBottomMargin"));
+ // last list item
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraph(3), "ParaBottomMargin"));
+}
+
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132802, "tdf132802.docx")
+{
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:spacing", "after", "0");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:spacing", "after", "0");
+ // This was 0 (list auto spacing is not zero before tables)
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:pPr/w:spacing", "after", "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "0");
+ // This was 0 (list auto spacing is not zero at the end of table cells)
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:p[2]/w:pPr/w:spacing", "after", "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "280");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc/w:p[1]/w:pPr/w:spacing", "after", "280");
+ // This was 0 (list auto spacing is not zero at list end)
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:spacing", "after", "280");
}
DECLARE_OOXMLEXPORT_TEST(testTdf129575_directBefore, "tdf129575-directBefore.docx")