summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx25
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx7
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
3 files changed, 25 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index c40a2ed802..3d8029f16d 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -761,6 +761,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);
@@ -769,13 +775,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))),
@@ -1250,16 +1257,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()
@@ -1268,7 +1279,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 5e64682cec..4af4bb137a 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& );