Hi Cedric, I recently updated http://cgit.freedesktop.org/~vmiklos/ooo-gsoc/tree/writer/table.odt?h=ooo-test-files and the patch is necessary to avoid a crash in the exporter. OK to push the attached patch? Thanks.
From 35d860e8d244f03e91751cedd13b21f8613cb5f1 Mon Sep 17 00:00:00 2001 From: Miklos Vajna <vmiklos@frugalware.org> Date: Wed, 13 Oct 2010 03:14:00 +0200 Subject: [PATCH] RTF: fix for nested tables The case when the original and the nested table has different cell / row number is now handled. This is done by invalidating the table writer before starting a new table and after finishing one. This is needed to prevent a crash when exporting such tables and also to produce correct output, which conforms to the specification. --- sw/source/filter/ww8/rtfattributeoutput.cxx | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 07ea880..a2931fe 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -299,6 +299,8 @@ void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextN { ww8::WW8TableNodeInfoInner::Pointer_t pInner( pTextNodeInfo->getInnerForDepth( nDepth ) ); + delete m_pTableWrt, m_pTableWrt = NULL; + StartTable( pInner ); StartTableRow( pInner ); StartTableCell( pInner ); @@ -965,8 +967,10 @@ void RtfAttributeOutput::EndTable() { OSL_TRACE("%s", OSL_THIS_FUNC); - if ( m_nTableDepth > 0 ) + if ( m_nTableDepth > 0 ) { m_nTableDepth--; + delete m_pTableWrt, m_pTableWrt = NULL; + } // We closed the table; if it is a nested table, the cell that contains it // still continues -- 1.7.2.1
Attachment:
pgp24hw3Mw1PM.pgp
Description: PGP signature