[Libreoffice-commits] core.git: sw/qa writerfilter/source

Szabolcs Toth (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 16 08:13:17 UTC 2019


 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 dff3ae42d94fdf97c856c4a4d1e66234604927f4
Author:     Szabolcs Toth <szabolcs450 at gmail.com>
AuthorDate: Sat Dec 7 08:57:32 2019 +0100
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Mon Dec 16 09:12:38 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 <nemeth at numbertext.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 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);


More information about the Libreoffice-commits mailing list