summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docxbin0 -> 12167 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport3.cxx11
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx5
3 files changed, 16 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf129442_RightBorder.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 22f898cec49b..d9982a3e3da7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -1033,6 +1033,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 5ab5a76825f5..fc23c724dde2 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -827,6 +827,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 );