diff options
author | László Németh <nemeth@numbertext.org> | 2018-08-10 11:49:14 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-09-02 13:13:15 +0200 |
commit | 5e2caf236091c71b2148970eba36b22655d8845a (patch) | |
tree | b6afa44ceb4afcfce65c5464edd8d020e26fdfc7 /sw | |
parent | 307e84ac706345510a4d347fbaaf3d53f8249dea (diff) |
tdf#119188 DOCX import: fix zero margins of numbered lines in cells
regression from 5c6bce38a01b21403a603acd3148cf3bbb4c685f
(tdf#104354 DOCX import: fix paragraph auto spacing in tables).
Change-Id: I486d155eb4463599ab922837fd2f4347b48e0851
Reviewed-on: https://gerrit.libreoffice.org/58818
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf119188_list_margin_in_cell.docx | bin | 0 -> 13663 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf119188_list_margin_in_cell.docx b/sw/qa/extras/ooxmlexport/data/tdf119188_list_margin_in_cell.docx Binary files differnew file mode 100644 index 000000000000..02b538685f47 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf119188_list_margin_in_cell.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index e289d3a40dba..e412f8703c07 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -609,6 +609,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113608_runAwayNumbering, "tdf113608_runAwayNumbe CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(2), "NumberingStyleName")); } +DECLARE_OOXMLEXPORT_TEST(testTdf119188_list_margin_in_cell, "tdf119188_list_margin_in_cell.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + + // lists with auto margings in cells: top margin of the first paragraph is zero, + // but not the bottom margin of the last paragraph, also other list items have got + // zero margins. + + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(2, xCell->getText()), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(494), getProperty<sal_Int32>(getParagraphOfText(3, xCell->getText()), "ParaBottomMargin")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |