diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-05-18 13:33:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-18 15:50:03 +0100 |
commit | ecb6931da61d73a9ac17aabed8f94cf74000edfa (patch) | |
tree | 2208b620e987ff15cda4a01804d5632a35c71a1d /sw | |
parent | 775fd7f613ae955d144aa77852ff7ed4eae44897 (diff) |
don't fail on export of ooo96040-2.odt to docx
If we want to close a cell of a table which encloses another table, then close
that enclosed table first.
These are pretty pathalogical old-school tables. For now assume this can only
occur when the row of the enclosed table is cleanly closed and assert if that
isn't the case.
Change-Id: I28e4d40072cb8d92be361716e82574075b15dd89
Diffstat (limited to 'sw')
-rw-r--r-- | sw/ooxmlexport_setup.mk | 1 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/ooo96040-2.odt | bin | 308517 -> 289214 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 8 |
4 files changed, 17 insertions, 0 deletions
diff --git a/sw/ooxmlexport_setup.mk b/sw/ooxmlexport_setup.mk index 5a0cc3b2ef20..a3a2182cd9c4 100644 --- a/sw/ooxmlexport_setup.mk +++ b/sw/ooxmlexport_setup.mk @@ -30,6 +30,7 @@ define sw_ooxmlexport_components chart2/source/controller/chartcontroller \ comphelper/util/comphelp \ configmgr/source/configmgr \ + dbaccess/util/dba \ drawinglayer/drawinglayer \ embeddedobj/util/embobj \ filter/source/config/cache/filterconfig1 \ diff --git a/sw/qa/extras/ooxmlexport/data/ooo96040-2.odt b/sw/qa/extras/ooxmlexport/data/ooo96040-2.odt Binary files differindex e8e7e997f0e5..35a1858e533e 100644 --- a/sw/qa/extras/ooxmlexport/data/ooo96040-2.odt +++ b/sw/qa/extras/ooxmlexport/data/ooo96040-2.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 4cf50c9433e9..a7f6078c6f7d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -262,6 +262,14 @@ DECLARE_OOXMLEXPORT_TEST(testOldComplexMergeleft, "tdf90681-2.odt") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[2]/w:tc[1]/w:tcPr/w:vMerge", "val", "continue"); } +DECLARE_OOXMLEXPORT_TEST(testOldComplexMergeTableInTable, "ooo96040-2.odt") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + + if (!pXmlDoc) + return; +} + DECLARE_OOXMLEXPORT_TEST(testTablePreferredWidth, "tablePreferredWidth.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ad8e94d74277..986f3335fd7b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -736,6 +736,14 @@ void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointe if ( bEndCell ) { + while (pInner->getDepth() < m_tableReference->m_nTableDepth) + { + //we expect that the higher depth row was closed, and + //we are just missing the table close + assert(lastOpenCell.back() == -1 && lastClosedCell.back() == -1); + EndTable(); + } + SyncNodelessCells(pInner, nCell, nRow); sal_Int32 nClosedCell = lastClosedCell.back(); |