summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2010-10-18 13:54:27 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2010-10-18 17:17:34 +0200
commit3142fdfc23869f5ef8d1a3a6bc407466f8b94426 (patch)
tree47205dbaa5a2ccbc003cfdf0e405e0000dc59c48 /sw
parent888562cc08960f42669146de283fb0a1fac189fb (diff)
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.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx11
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx5
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx1
3 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index e29526efaa6f..98e28309f3f0 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 22e05ee647eb..7fc36136c16d 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 b96e6f7ac7c9..e87d0081a207 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 );