[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Mon Oct 18 08:18:42 PDT 2010


 sw/source/filter/ww8/rtfattributeoutput.cxx |   11 ++++++++++-
 sw/source/filter/ww8/rtfexport.cxx          |    5 -----
 sw/source/filter/ww8/rtfexport.hxx          |    1 -
 3 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 16824cb6bb8b41a05cd836610814c04e1f0ed5eb
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Mon Oct 18 13:54:27 2010 +0200

    RTF: fix non-text frames
    
    Previously the exporter just crashed when the document contained a non-text
    frame (e.g. table). Fix this by properly calling MSWordExportBase::WriteText()
    instead of our custom method that handled text frames only.

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index e29526e..98e2830 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1490,7 +1490,16 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
                  */
                 OString aSave = m_aRun.makeStringAndClear();
                 m_rExport.bRTFFlySyntax = true;
-                m_rExport.OutContent(*rFrame.GetContent());
+
+                const SwFrmFmt& rFrmFmt = rFrame.GetFrmFmt( );
+                const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx();
+                ULONG nStt = pNodeIndex ? pNodeIndex->GetIndex()+1                  : 0;
+                ULONG nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0;
+                m_rExport.SaveData( nStt, nEnd );
+                m_rExport.mpParentFrame = &rFrame;
+                m_rExport.WriteText( );
+                m_rExport.RestoreData();
+
                 m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_PARD;
                 m_rExport.bRTFFlySyntax = false;
                 m_aRun.append(aSave);
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 282dc2e..b1aed21 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1116,11 +1116,6 @@ USHORT RtfExport::GetRedline( const String& rAuthor )
     }
 }
 
-void RtfExport::OutContent( const SwNode& rNode )
-{
-        OutputContentNode(*rNode.GetCntntNode());
-}
-
 void RtfExport::OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage )
 {
     OSL_TRACE("%s start", OSL_THIS_FUNC);
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index b96e6f7..e87d008 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -176,7 +176,6 @@ public:
     rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc);
     rtl::OString OutHex(ULONG nHex, BYTE nLen);
     void OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage );
-    void OutContent( const SwNode& rNode );
 
     USHORT GetColor( const Color& rColor ) const;
     void InsColor( const Color& rCol );


More information about the Libreoffice-commits mailing list