sw/qa/extras/ooxmlexport/data/tableCurrupt.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 9 +++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 11 +++++++++++ sw/source/filter/ww8/docxattributeoutput.hxx | 2 ++ 4 files changed, 22 insertions(+)
New commits: commit 0415e2696156b25226f21085a0716187f83c2f4b Author: PriyankaGaikwad <priyanka.gaik...@synerzip.com> Date: Thu Feb 27 17:42:52 2014 +0530 fdo#73219 File corruption: Table in header Description: File corrupt due to the end tag </w:tc> </w:tr> </w:tbl> are missing after roundtrip in header4.xml Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/8378 Change-Id: Ib05a50b3b3beca6c744b93360f9341ddcaa1a22a diff --git a/sw/qa/extras/ooxmlexport/data/tableCurrupt.docx b/sw/qa/extras/ooxmlexport/data/tableCurrupt.docx new file mode 100644 index 0000000..1deda7d Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tableCurrupt.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 094519c..4c1ba4f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2962,6 +2962,15 @@ DECLARE_OOXMLEXPORT_TEST(testFdo74792, "fdo74792.docx") CPPUNIT_ASSERT( xInputStream.is() ); } +DECLARE_OOXMLEXPORT_TEST(testTableCurruption, "tableCurrupt.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/header4.xml"); + if (!pXmlDoc) + return; + CPPUNIT_ASSERT(pXmlDoc) ; + assertXPath(pXmlDoc, "/w:hdr/w:tbl[1]/w:tr[1]/w:tc[1]",1); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d7d9dea..2fe102c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -251,9 +251,18 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText { ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) ); + if (m_tableReference->m_pOldTablepInner && m_tableReference->m_pOldTablepInner->getTable() == pInner->getTable() && nCurrentDepth > 1 && nDepth != 1) + { + m_tableReference->m_pOldTablepInner = pInner; + break; + } + else + { StartTable( pInner ); StartTableRow( pInner ); StartTableCell( pInner ); + m_tableReference->m_pOldTablepInner = pInner; + } } m_tableReference->m_nTableDepth = nCurrentDepth; @@ -2366,8 +2375,10 @@ void DocxAttributeOutput::switchHeaderFooter(bool isHeaderFooter, sal_Int32 inde { m_oldTableReference->m_bTableCellOpen = m_tableReference->m_bTableCellOpen; m_oldTableReference->m_nTableDepth = m_tableReference->m_nTableDepth; + m_oldTableReference->m_pOldTablepInner = m_tableReference->m_pOldTablepInner; m_tableReference->m_bTableCellOpen = false; m_tableReference->m_nTableDepth = 0; + m_pSectionInfo.reset(); } else if( index == -1) { diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index b765315..6012f43 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -113,6 +113,8 @@ struct TableReference /// Remember the current table depth. sal_uInt32 m_nTableDepth; + ww8::WW8TableNodeInfoInner::Pointer_t m_pOldTablepInner; + TableReference() : m_bTableCellOpen(false), m_nTableDepth(0) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits