Kaydet (Commit) ecb6931d authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst 775fd7f6
......@@ -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 \
......
......@@ -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");
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment