diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-12-02 15:57:31 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-12-03 11:13:35 +0100 |
commit | 1db43df96c97a2f61ca74df154500553b35ebdd8 (patch) | |
tree | 71c40c157cd14b163b453c72f06d38b70eabbddf | |
parent | 2c29bb06b76097d6cf745b87a481bda450bc0178 (diff) |
fdo#32039: Missing outline feature in new RTF export filterfeature/winshrink
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 25 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.hxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 2 |
3 files changed, 25 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index b3c08280f4..d9696139fa 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -764,6 +764,12 @@ void RtfExport::OutputLinkedOLE( const rtl::OUString& ) OSL_TRACE("%s", OSL_THIS_FUNC); } +void RtfExport::OutputTextNode( const SwTxtNode& rNode ) +{ + if ( !m_bOutOutlineOnly || rNode.IsOutline( ) ) + MSWordExportBase::OutputTextNode( rNode ); +} + void RtfExport::AppendSection( const SwPageDesc* pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum ) { OSL_TRACE("%s", OSL_THIS_FUNC); @@ -772,13 +778,14 @@ void RtfExport::AppendSection( const SwPageDesc* pPageDesc, const SwSectionFmt* AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() ); } -RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter ) +RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter, bool bOutOutlineOnly ) : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ), m_pFilter( pFilter ), m_pWriter( pWriter ), m_pAttrOutput( NULL ), m_pSections( NULL ), m_pSdrExport( NULL ), + m_bOutOutlineOnly( bOutOutlineOnly ), eDefaultEncoding( rtl_getTextEncodingFromWindowsCharset( sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))), @@ -1254,16 +1261,20 @@ void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_ /// Glue class to call RtfExport as an internal filter, needed by copy&paste support. class SwRTFWriter : public Writer { - public: - SwRTFWriter( const String& rFilterName, const String& rBaseURL ); - virtual ~SwRTFWriter(); - virtual ULONG WriteStream(); + private: + bool bOutOutlineOnly; + + public: + SwRTFWriter( const String& rFilterName, const String& rBaseURL ); + virtual ~SwRTFWriter(); + virtual ULONG WriteStream(); }; -SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL ) +SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL ) { OSL_TRACE("%s", OSL_THIS_FUNC); SetBaseURL( rBaseURL ); + bOutOutlineOnly = 'O' == rFltName.GetChar( 0 ); } SwRTFWriter::~SwRTFWriter() @@ -1272,7 +1283,7 @@ SwRTFWriter::~SwRTFWriter() ULONG SwRTFWriter::WriteStream() { OSL_TRACE("%s", OSL_THIS_FUNC); - RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this ); + RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this, bOutOutlineOnly ); aExport.ExportDocument( true ); return 0; } diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 5d5a186d88..50bd72b5a2 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -70,6 +70,7 @@ class RtfExport : public MSWordExportBase MSWordSections *m_pSections; RtfSdrExport *m_pSdrExport; + bool m_bOutOutlineOnly; public: /// Access to the attribute output class. @@ -137,6 +138,9 @@ protected: /// Return value indicates if an inherited outline numbering is suppressed. virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt); + /// Output SwTxtNode is depending on outline export mode + virtual void OutputTextNode( const SwTxtNode& ); + /// Output SwGrfNode virtual void OutputGrfNode( const SwGrfNode& ); @@ -150,7 +154,8 @@ protected: public: /// Pass the pDocument, pCurrentPam and pOriginalPam to the base class. RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, - SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter ); + SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter, + bool bOutOutlineOnly = false ); /// Destructor. virtual ~RtfExport(); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 59bf5827d5..a8074810bc 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -749,7 +749,7 @@ protected: virtual void UpdatePosition( SwWW8AttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd ); /// Output SwTxtNode - void OutputTextNode( const SwTxtNode& ); + virtual void OutputTextNode( const SwTxtNode& ); /// Output SwTableNode void OutputTableNode( const SwTableNode& ); |