[Libreoffice-commits] core.git: Branch 'distro/collabora/dcm-6.2' - sw/qa writerfilter/source

Szabolcs Toth (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 7 06:42:07 UTC 2021


 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx                |   11 +++++++++++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   12 +++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 23ae22b244230b42979d206943149924efc9a80c
Author:     Szabolcs Toth <szabolcs450 at gmail.com>
AuthorDate: Thu Feb 20 10:54:19 2020 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Jul 6 21:49:43 2021 +0300

    tdf#130799 DOCX import: fix missing inside vertical borders
    
    caused by incomplete handling of tables with 1-column
    rows with merged cells.
    
    Have to check the rows below current to see if they contain
    also one cell, therefore form a column, or more than one cell,
    in which case do not remove vertical borders.
    
    Regression from commit: 8a2eb40abbd52d960dd21308157186be0ca9dd3d
    (tdf#129442 DOCX import: fix right border of 1-column tables).
    
    Change-Id: If9ca7ccd42255e78c61b6271e19262ab5cc8e439
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89081
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 3726c9022b97..e2f9d6b1e14d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -1050,6 +1050,17 @@ DECLARE_OOXMLEXPORT_TEST(testBottomBorders, "tdf129452_BottomBorders.docx")
 
 #endif
 
+DECLARE_OOXMLEXPORT_TEST(testVerticalBorders, "calendar3.docx")
+{
+    // tdf#130799: Inside vertical borders of a table should not be missing.
+
+    xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+    if (!pXmlDocument)
+        return;
+    // Left and right borders.
+    assertXPathChildren(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[3]/w:tcPr/w:tcBorders", 2);
+}
+
 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 4cb518eb29d8..458feaa6cd96 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -836,7 +836,17 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
                 // 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);
+                    bool isOneCol = true;
+                    for (size_t i = nRow; i < m_aCellProperties.size(); i++)
+                    {
+                        if (m_aCellProperties[i].size() > 1)
+                        {
+                            isOneCol = false;
+                            break;
+                        }
+                    }
+                    if (isOneCol)
+                        rInfo.pTableBorders->Erase(META_PROP_VERTICAL_BORDER);
                 }
                 // Do not apply horizontal borders to a one row table.
                 else if (m_aCellProperties.size() == 1 && aRowOfCellsIterator->size() > 1)


More information about the Libreoffice-commits mailing list