[Libreoffice-commits] core.git: sw/qa writerfilter/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 7 12:25:21 UTC 2020
sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 7 ++++---
sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 9 +++++++++
writerfilter/source/dmapper/DomainMapperTableManager.cxx | 6 ++++++
3 files changed, 19 insertions(+), 3 deletions(-)
New commits:
commit f1c7aa5267a8045892890954df3c269a3abaab99
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Mon Apr 6 12:02:10 2020 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Tue Apr 7 14:24:45 2020 +0200
tdf#131819 DOCX import: fix fixed size nested table
Auto width nested table with fixed width cells
is imported as fixed width table to keep the
original cell widths, which define the width of
the table, too.
Partial revert of commit bed818c5d5e92a0b189f25e18495fc205d949128
(tdf#104876 writerfilter: m_bTableSizeTypeInserted = false here).
Change-Id: If58c58a792853e1084ff1d8f9bf6ef74a593b1bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91764
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index f19a95342714..1a59b2f8f920 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -371,11 +371,12 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx")
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo73389,"fdo73389.docx")
{
// The width of the inner table was too large. The first fix still converted
- // the "auto" table width to a fixed one. The recent fix uses variable width.
+ // the "auto" table width to a fixed one. The second fix used variable width.
+ // The recent fix uses fixed width again, according to the fixed width cells.
xmlDocPtr pXmlDoc = parseExport();
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","type","pct");
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","w","5000");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","type","dxa");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:tbl/w:tblPr/w:tblW","w","1611");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf59274, "tdf59274.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 511b8f0ff890..3eac4838f146 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -226,6 +226,15 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testNumberedList,"NumberedList.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:numId","val", "0");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf131819, "NumberedList.docx")
+{
+ // keep width of fixed size cells in the nested table
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ // These were 4030 and 4249.
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[1]", "w", "3841");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblGrid/w:gridCol[2]", "w", "4049");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76597, "fdo76597.docx")
{
// check XML
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 891a00d4a63c..a1bb10e74850 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -180,6 +180,12 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, 0 );
m_bTableSizeTypeInserted = true;
}
+ else if (getTableDepth() > 1)
+ {
+ // tdf#131819 limiting the fix for nested tables temporarily
+ // TODO revert the fix for tdf#104876 and reopen it
+ m_bTableSizeTypeInserted = true;
+ }
}
}
#ifdef DBG_UTIL
More information about the Libreoffice-commits
mailing list