summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-03-30 12:51:35 +0200
committerMichael Stahl <mst@openoffice.org>2010-03-30 12:51:35 +0200
commit7e1bf0010d130597d5658a117737e7d9747dee91 (patch)
tree39f62b5023bc20189e76d9c04986d733bc4c5c03
parent5d58845170113179d5bc9e60d2411196b8d30240 (diff)
sw33bf03: #i110454#: fix ASSERT from WW8Export::ExportDocument_Impl()
-rw-r--r--sw/inc/shellio.hxx7
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx4
-rw-r--r--sw/source/filter/writer/writer.cxx16
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx8
4 files changed, 19 insertions, 16 deletions
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 45d413ced105..9208659d9f66 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -439,13 +439,14 @@ class SW_DLLPUBLIC Writer : public SvRefBase
SwAsciiOptions aAscOpts;
String sBaseURL;
+ SvStream * m_pStream;
+
void _AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont );
void _AddFontItems( SfxItemPool& rPool, USHORT nWhichId );
protected:
Writer_Impl* pImpl;
- SvStream* pStrm;
SwPaM* pOrigPam; // der letze zu bearbeitende Pam
const String* pOrigFileName;
@@ -537,9 +538,9 @@ public:
inline SvStream& OutLong( long nVal ) { return OutLong( Strm(), nVal ); }
inline SvStream& OutULong( ULONG nVal ) { return OutULong( Strm(), nVal ); }
- void SetStrm( SvStream& rStrm ) { pStrm = &rStrm; }
+ void SetStream(SvStream *const pStream) { m_pStream = pStream; }
#ifndef DBG_UTIL
- SvStream& Strm() { return *pStrm; }
+ SvStream& Strm() { return *m_pStream; }
#else
SvStream& Strm();
#endif
diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx
index ecbcfbfe7c7f..b5e2f7b316ea 100644
--- a/sw/source/filter/rtf/rtfatr.cxx
+++ b/sw/source/filter/rtf/rtfatr.cxx
@@ -513,12 +513,12 @@ void OutRTF_SwFlyFrmFmt( SwRTFWriter& rRTFWrt )
// ueberhaupt eigene Attribute gibt !
SvMemoryStream aTmpStrm;
SvStream* pSaveStrm = &rRTFWrt.Strm();
- rRTFWrt.SetStrm( aTmpStrm );
+ rRTFWrt.SetStream( &aTmpStrm );
rRTFWrt.bRTFFlySyntax = false;
OutRTF_SwFmt( rRTFWrt, *rRTFWrt.pFlyFmt );
- rRTFWrt.SetStrm( *pSaveStrm ); // Stream-Pointer wieder zurueck
+ rRTFWrt.SetStream( pSaveStrm ); // Stream-Pointer wieder zurueck
if ( aTmpStrm.GetEndOfData() ) // gibt es SWG spezifische Attribute?
{
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 2ed742255173..66ad4f87b699 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -145,7 +145,9 @@ void Writer_Impl::InsertBkmk(const ::sw::mark::IMark& rBkmk)
*/
Writer::Writer()
- : pImpl(0), pStrm(0), pOrigPam(0), pOrigFileName(0), pDoc(0), pCurPam(0)
+ : pImpl(0)
+ , m_pStream(0)
+ , pOrigPam(0), pOrigFileName(0), pDoc(0), pCurPam(0)
{
bWriteAll = bShowProgress = bUCS2_WithStartChar = true;
bASCII_NoLastLineEnd = bASCII_ParaAsBlanc = bASCII_ParaAsCR =
@@ -181,7 +183,7 @@ void Writer::ResetWriter()
pCurPam = 0;
pOrigFileName = 0;
pDoc = 0;
- pStrm = 0;
+ m_pStream = 0;
bShowProgress = bUCS2_WithStartChar = TRUE;
bASCII_NoLastLineEnd = bASCII_ParaAsBlanc = bASCII_ParaAsCR =
@@ -253,8 +255,8 @@ SwPaM* Writer::NewSwPaM( SwDoc & rDoc, ULONG nStartIdx, ULONG nEndIdx,
#ifdef DBG_UTIL
SvStream& Writer::Strm()
{
- ASSERT( pStrm, "Oh-oh. Dies ist ein Storage-Writer. Gleich knallts!" );
- return *pStrm;
+ ASSERT( m_pStream, "Oh-oh. Writer with no Stream!" );
+ return *m_pStream;
}
#endif
@@ -318,7 +320,7 @@ ULONG Writer::Write( SwPaM& rPaM, SvStream& rStrm, const String* pFName )
return nResult;
}
- pStrm = &rStrm;
+ m_pStream = &rStrm;
pDoc = rPaM.GetDoc();
pOrigFileName = pFName;
pImpl = new Writer_Impl( *pDoc );
@@ -590,7 +592,7 @@ ULONG StgWriter::WriteStream()
ULONG StgWriter::Write( SwPaM& rPaM, SvStorage& rStg, const String* pFName )
{
- pStrm = 0;
+ SetStream(0);
pStg = &rStg;
pDoc = rPaM.GetDoc();
pOrigFileName = pFName;
@@ -611,7 +613,7 @@ ULONG StgWriter::Write( SwPaM& rPaM, SvStorage& rStg, const String* pFName )
ULONG StgWriter::Write( SwPaM& rPaM, const uno::Reference < embed::XStorage >& rStg, const String* pFName, SfxMedium* pMedium )
{
- pStrm = 0;
+ SetStream(0);
pStg = 0;
xStg = rStg;
pDoc = rPaM.GetDoc();
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 9eb8fec9de7c..709fa282e6cb 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2982,7 +2982,6 @@ void WW8Export::ExportDocument_Impl()
pFib = new WW8Fib( bWrtWW8 ? 8 : 6 );
- SvStream* pOldStrm = &(Strm()); // JP 19.05.99: wozu das ???
SvStorageStreamRef xWwStrm( GetWriter().GetStorage().OpenSotStream( aMainStg ) );
SvStorageStreamRef xTableStrm( xWwStrm ), xDataStrm( xWwStrm );
xWwStrm->SetBufferSize( 32768 );
@@ -3002,7 +3001,7 @@ void WW8Export::ExportDocument_Impl()
xDataStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
}
- GetWriter().SetStrm( *xWwStrm );
+ GetWriter().SetStream( & *xWwStrm );
pTableStrm = &xTableStrm;
pDataStrm = &xDataStrm;
@@ -3024,7 +3023,8 @@ void WW8Export::ExportDocument_Impl()
{
bEncrypt =true;
- GetWriter().SetStrm( *aTempMain.GetStream( STREAM_READWRITE | STREAM_SHARE_DENYWRITE ) );
+ GetWriter().SetStream(
+ aTempMain.GetStream( STREAM_READWRITE | STREAM_SHARE_DENYWRITE ) );
pTableStrm = aTempTable.GetStream( STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
@@ -3176,7 +3176,7 @@ void WW8Export::ExportDocument_Impl()
delete pPiece;
delete pDop;
delete pFib;
- GetWriter().SetStrm( *pOldStrm );
+ GetWriter().SetStream( 0 );
xWwStrm->SetBufferSize( 0 );