Kaydet (Commit) 6f416eb8 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

best effort export of ooo72950-1.odt to docx without crashing

the curious case of ooo72950-1.odt which has no nodes in the first line of the
table as seen from the visual layout perspective seeing as the table is split
over two columns with the second column portion of the table higher than the
left column portion

Change-Id: I38526bf80ff8cef1688aa5f5f686e437c4a3d6e5
(cherry picked from commit f81c775b)
üst 6b50164c
...@@ -843,6 +843,12 @@ DECLARE_OOXMLEXPORT_TEST(testKDE216114, "kde216114-1.odt") ...@@ -843,6 +843,12 @@ DECLARE_OOXMLEXPORT_TEST(testKDE216114, "kde216114-1.odt")
assertXPath(pXmlDoc, "//w:pict", 1); assertXPath(pXmlDoc, "//w:pict", 1);
} }
DECLARE_OOXMLEXPORT_TEST(testOO72950, "ooo72950-1.odt")
{
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
assertXPath(pXmlDoc, "//w:tbl", 1);
}
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -250,7 +250,7 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText ...@@ -250,7 +250,7 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
sal_uInt32 nRow = pTextNodeInfo->getRow(); sal_uInt32 nRow = pTextNodeInfo->getRow();
sal_uInt32 nCell = pTextNodeInfo->getCell(); sal_uInt32 nCell = pTextNodeInfo->getCell();
if ( nRow == 0 && nCell == 0 ) if (nCell == 0)
{ {
// Do we have to start the table? // Do we have to start the table?
// [If we are at the right depth already, it means that we // [If we are at the right depth already, it means that we
...@@ -260,14 +260,14 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText ...@@ -260,14 +260,14 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
if ( nCurrentDepth > m_tableReference->m_nTableDepth ) if ( nCurrentDepth > m_tableReference->m_nTableDepth )
{ {
// Start all the tables that begin here // Start all the tables that begin here
for ( sal_uInt32 nDepth = m_tableReference->m_nTableDepth + 1; nDepth <= pTextNodeInfo->getDepth(); ++nDepth ) for ( sal_uInt32 nDepth = m_tableReference->m_nTableDepth + 1; nDepth <= nCurrentDepth; ++nDepth )
{ {
ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) ); ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) );
StartTable( pInner ); StartTable( pInner );
StartTableRow( pInner ); StartTableRow( pInner );
StartTableCell(pInner, 0, 0); StartTableCell(pInner, 0, nDepth == nCurrentDepth ? nRow : 0);
} }
m_tableReference->m_nTableDepth = nCurrentDepth; m_tableReference->m_nTableDepth = nCurrentDepth;
......
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