sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 13 +++++++++++++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-)
New commits: commit 39e138902d05fbb00fda8003908c851d2f3ecb00 Author: Szabolcs Toth <szabolcs...@gmail.com> AuthorDate: Sat Dec 7 08:57:32 2019 +0100 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Tue Dec 17 11:29:49 2019 +0100 tdf#129242 Regression fixed for one cell table borders Had to check an additional criteria before removing inside borders. Change-Id: I0828d973bd331e65ebabc1fe2e2f25f1bcaf58b0 Reviewed-on: https://gerrit.libreoffice.org/84676 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit dff3ae42d94fdf97c856c4a4d1e66234604927f4) Reviewed-on: https://gerrit.libreoffice.org/85199 Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx b/sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx new file mode 100644 index 000000000000..58045c971c82 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index c78ecb5aff38..251ef426c58f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -1012,6 +1012,19 @@ DECLARE_OOXMLEXPORT_TEST(testSingleCellTableBorders, "tdf124399_SingleCellTableB assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tcPr/w:tcBorders/w:bottom [@w:val = 'nil']", 1); } +DECLARE_OOXMLEXPORT_TEST(testInsideBorders, "tdf129242_InsideBorders.docx") +{ + // tdf#129242: Don't remove inside borders if the table has more than one cells. + + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // If this is not 0, then inside borders are removed. + assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders", 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 d6be09fbd4e4..b8923e734bee 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -824,7 +824,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl #endif // Do not apply horizontal and vertical borders to a one cell table. - if (m_aCellProperties.size() <= 1) + if (m_aCellProperties.size() <= 1 && aRowOfCellsIterator->size() <= 1) { rInfo.pTableBorders->Erase(META_PROP_HORIZONTAL_BORDER); rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits