[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa writerfilter/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 29 06:35:48 UTC 2021


 sw/qa/extras/ooxmlexport/data/tdf140597.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx    |   13 +++++++++++++
 writerfilter/source/dmapper/TableManager.hxx |   11 ++++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 337f86e5023a2d2ddc4fdbc82a3a5d986db90110
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Tue Mar 9 11:11:10 2021 +0100
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Thu Apr 29 08:35:15 2021 +0200

    tdf#140597 DOCX import: fix missing tblPrEx border
    
    of first table cells, caused by the workaround for tdf#138612.
    
    Now property set of a new cell is a copy of the table exception
    property set of the table row, as needed for the import of the
    table style inheritance.
    
    Regression from commit f319d6b543c2367546bc80d138e56ed03731e265
    (tdf#138612 DOCX import: fix lost part of split table cell).
    
    Change-Id: Iaf6637e757fbfeef7651a4300a7f65a23615f5c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112247
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 53884e8fe92597e909e4fa5599192783c3d31a56)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112225
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit 1247f2f3d8f343e0e809a1aec0ce0e20005caafd)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114729
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf140597.docx b/sw/qa/extras/ooxmlexport/data/tdf140597.docx
new file mode 100644
index 000000000000..36db7d9bea2b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf140597.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 83aef189b416..4a1eddc3c8ae 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -760,6 +760,19 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf138612, "tdf138612.docx")
     assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[6]/w:tc[2]/w:tcPr/w:vMerge", 0);
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf140597, "tdf140597.docx")
+{
+    xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+
+    // There were missing tblPrEx table exception borders
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[3]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:top");
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[4]/w:tc[1]/w:tcPr/w:tcBorders/w:start");
+}
+
 DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128646, "tdf128646.docx")
 {
     // The problem was that not hidden shapes anchored to empty hidden paragraphs were imported as hidden.
diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx
index caf33597a206..40ef2474fbd1 100644
--- a/writerfilter/source/dmapper/TableManager.hxx
+++ b/writerfilter/source/dmapper/TableManager.hxx
@@ -114,7 +114,14 @@ class TableManager : public virtual SvRefBase
 
         void resetCellProps()
         {
-            mpCellProps = getTableExceptionProps();
+            // copy tblPrEx table exception properties, if they exist
+            if (getTableExceptionProps().is())
+            {
+                mpCellProps = new TablePropertyMap;
+                mpCellProps->InsertProps(getTableExceptionProps().get());
+            }
+            else
+                mpCellProps.clear();
         }
 
         void setCellProps(TablePropertyMapPtr pProps)
@@ -149,6 +156,8 @@ class TableManager : public virtual SvRefBase
         void setTableExceptionProps(TablePropertyMapPtr pProps)
         {
             mpTableExceptionProps = pProps;
+            // set table exception properties of the first cell
+            resetCellProps();
         }
 
         const TablePropertyMapPtr& getTableExceptionProps() const


More information about the Libreoffice-commits mailing list