[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Wed Oct 13 03:19:26 PDT 2010


 sw/source/filter/ww8/rtfattributeoutput.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d42e05c011a0a6dd50674d41cc6adca7910013f4
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Wed Oct 13 03:14:00 2010 +0200

    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.

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


More information about the Libreoffice-commits mailing list