summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2010-10-13 03:14:00 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2010-10-13 12:19:13 +0200
commit99e2ad55f491c346cbf219091d81546215040c9b (patch)
tree23432cfcde13c1cd20c2b0737542d26c8414453f /sw
parentc3061ad6c3461bca2c658444a97222898937e906 (diff)
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.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 07ea880c3076..a2931fe35c4d 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