summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Toth <szabolcs450@gmail.com>2019-12-07 08:57:32 +0100
committerLászló Németh <nemeth@numbertext.org>2019-12-16 09:12:38 +0100
commitdff3ae42d94fdf97c856c4a4d1e66234604927f4 (patch)
treee657f1ecebc2a7311a9c5a3f4ef248e8b5cb3a3e
parente57d90cd4e51a1353eafc87bb29cfe6076704a7c (diff)
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 <nemeth@numbertext.org>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docxbin0 -> 12222 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx13
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx2
3 files changed, 14 insertions, 1 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf129242_InsideBorders.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index b11f3f0d45e5..22f898cec49b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -1021,6 +1021,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 fb596a983204..db063663c326 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -821,7 +821,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);