sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 11 +++++++++++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 5 +++++ 3 files changed, 16 insertions(+)
New commits: commit 327de796b8a44028b2d49387a977663c88f59956 Author: Szabolcs Toth <szabolcs...@gmail.com> AuthorDate: Tue Dec 17 14:54:39 2019 +0100 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Wed Jan 8 10:12:58 2020 +0100 tdf#129442 DOCX import: fix right border of 1-column tables Right border was missing in a 1-column table with disabled inside borders. This happened because LO applied the empty vertical borders to the right border of the table. Change-Id: Ib190689bf5059bfd7dbf07b07808cd761015f37e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85301 Reviewed-by: László Németh <nem...@numbertext.org> Tested-by: László Németh <nem...@numbertext.org> (cherry picked from commit 8a2eb40abbd52d960dd21308157186be0ca9dd3d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86261 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx new file mode 100644 index 000000000000..57ad24b61435 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 251ef426c58f..8e7a7149292e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -1024,6 +1024,17 @@ DECLARE_OOXMLEXPORT_TEST(testInsideBorders, "tdf129242_InsideBorders.docx") assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders", 0); } +DECLARE_OOXMLEXPORT_TEST(testRightBorder, "tdf129442_RightBorder.docx") +{ + // tdf#129442: Right border of a one column table was missing. + + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + // If the right border is missing like in the bug, then there is a <w:right w:val="nil" /> tag in tcBorders. + assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc/w:tcPr/w:tcBorders/w:end [@w:val = 'nil']", 0); +} CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 0f675839e176..21472dc0eddf 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -830,6 +830,11 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl rInfo.pTableBorders->Erase(META_PROP_HORIZONTAL_BORDER); rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER); } + // Do not apply vertical borders to a one column table. + else if (m_aCellProperties.size() > 1 && aRowOfCellsIterator->size() <= 1) + { + rInfo.pTableBorders->Erase(META_PROP_VERTICAL_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