sw/qa/extras/ooxmlexport/data/tdf129450_BottomBorder.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 12 ++++++++++++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 5 +++++ 3 files changed, 17 insertions(+)
New commits: commit 6b1bd2699b0bdad6dc42db741dea0717cf7c1d36 Author: Szabolcs Toth <szabolcs...@gmail.com> AuthorDate: Tue Dec 17 16:06:30 2019 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Mon Jan 6 12:18:58 2020 +0100 tdf#129450 DOCX import: fix bottom border of 1-row tables Bottom border was missing in a 1-row table with disabled inside borders. This happened because LO applied the empty horizontal borders to the bottom border of the table. Change-Id: I40140bf63297189edad13088f98fc5f869969c2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85303 Reviewed-by: László Németh <nem...@numbertext.org> Tested-by: László Németh <nem...@numbertext.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf129450_BottomBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf129450_BottomBorder.docx new file mode 100644 index 000000000000..df00bfe04421 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf129450_BottomBorder.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index d9982a3e3da7..41aa0b7d1ac8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -1045,6 +1045,18 @@ DECLARE_OOXMLEXPORT_TEST(testRightBorder, "tdf129442_RightBorder.docx") assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:tcPr/w:tcBorders/w:end [@w:val = 'nil']", 0); } +DECLARE_OOXMLEXPORT_TEST(testBottomBorder, "tdf129450_BottomBorder.docx") +{ + // tdf#129450: Missing bottom border in one row table. + + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // If there is no bottom border, it is shown in tcBorders. + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 0); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index fc23c724dde2..77bf9e3f901a 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -832,6 +832,11 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl { rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER); } + // Do not apply horizontal borders to a one row table. + else if (m_aCellProperties.size() == 1 && aRowOfCellsIterator->size() > 1) + { + rInfo.pTableBorders->Erase(META_PROP_HORIZONTAL_BORDER); + } lcl_computeCellBorders( rInfo.pTableBorders, *aCellIterator, nCell, nRow, bIsEndCol, bIsEndRow ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits