[Libreoffice-commits] core.git: sw/qa sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Tue Mar 10 07:27:37 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf107626.odt |binary
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 7 +++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 17 ++++++++++++++++-
3 files changed, 23 insertions(+), 1 deletion(-)
New commits:
commit 6db846c3c0bc1c44da1f3c7a8dea385930acc3b1
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Fri Mar 6 22:26:17 2020 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Tue Mar 10 08:27:02 2020 +0100
tdf#107626 DOCX table export: fix missing trailing cells
resulting broken table layout with incomplete cell merging,
for example, content in extra table rows and in columns
of different lengths.
Change-Id: Ic5057e43d4c66e34ffc1373030be66815ff52563
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90136
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/data/tdf107626.odt b/sw/qa/extras/ooxmlexport/data/tdf107626.odt
new file mode 100644
index 000000000000..b7c8489cd341
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf107626.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 991916ef6ca8..3b2c22e7e2d6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -324,6 +324,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf118812, "tdf118812_tableStyles-compre
assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[6]/w:tc/w:p/w:r[2]/w:rPr/w:sz", "val", "16");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf107626, "tdf107626.odt")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ // This was 2 (missing trailing cell in merged cell range)
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[3]/w:tc", 3);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf106970, "tdf106970.docx")
{
// The second paragraph (first numbered one) had 0 bottom margin:
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6b8d1f9a1085..dc840a227e38 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -945,9 +945,24 @@ void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointe
sal_Int32 nClosedCell = lastClosedCell.back();
if (nCell == nClosedCell)
{
- //Start missing trailing cell
+ //Start missing trailing cell(s)
++nCell;
StartTableCell(pInner, nCell, nRow);
+
+ //Continue on missing next trailing cell(s)
+ ww8::RowSpansPtr xRowSpans = pInner->getRowSpansOfRow();
+ sal_Int32 nRemainingCells = xRowSpans->size() - nCell;
+ for (sal_Int32 i = 1; i < nRemainingCells; ++i)
+ {
+ if (bForceEmptyParagraph)
+ {
+ m_pSerializer->singleElementNS(XML_w, XML_p);
+ }
+
+ EndTableCell(nCell);
+
+ StartTableCell(pInner, nCell, nRow);
+ }
}
if (bForceEmptyParagraph)
More information about the Libreoffice-commits
mailing list