diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-13 14:31:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-13 20:35:43 +0000 |
commit | ae5f857131cffc03882c246bafe198c2088247f2 (patch) | |
tree | 988347bbdb06b59ad548780ff9620526dbc87fdb | |
parent | 9240b9b7849de70fef6b944fe6ce3d1dbc02eb78 (diff) |
tidy this up and just use references
-rw-r--r-- | svtools/source/filter.vcl/wmf/emfwr.cxx | 157 | ||||
-rw-r--r-- | svtools/source/filter.vcl/wmf/emfwr.hxx | 6 | ||||
-rw-r--r-- | svtools/source/filter.vcl/wmf/wmf.cxx | 4 | ||||
-rw-r--r-- | svtools/source/filter.vcl/wmf/wmfwr.cxx | 4 |
4 files changed, 85 insertions, 86 deletions
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx index c87ad02ed63e..7e10170ffd11 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.cxx +++ b/svtools/source/filter.vcl/wmf/emfwr.cxx @@ -169,9 +169,9 @@ // - EMFWriter - // ------------- -BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pFilterConfigItem ) +BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pFilterConfigItem ) { - const ULONG nHeaderPos = rOStm.Tell(); + const ULONG nHeaderPos = m_rStm.Tell(); mpHandlesUsed = new BOOL[ MAXHANDLES ]; memset( mpHandlesUsed, 0, MAXHANDLES * sizeof( BOOL ) ); @@ -179,7 +179,6 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig mnLineHandle = mnFillHandle = mnTextHandle = HANDLE_INVALID; mbRecordOpen = FALSE; - mpStm = &rOStm; maVDev.EnableOutput( FALSE ); maVDev.SetMapMode( rMtf.GetPrefMapMode() ); mpFilterConfigItem = pFilterConfigItem; @@ -192,51 +191,51 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // seek over header // use [MS-EMF 2.2.11] HeaderExtension2 Object, otherwise resulting EMF cannot be converted with GetWinMetaFileBits() - rOStm.SeekRel( 108 ); + m_rStm.SeekRel( 108 ); // write initial values // set 100th mm map mode in EMF ImplBeginRecord( WIN_EMR_SETMAPMODE ); - (*mpStm) << (INT32) MM_ANISOTROPIC; + m_rStm << (INT32) MM_ANISOTROPIC; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETVIEWPORTEXTEX ); - (*mpStm) << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY(); + m_rStm << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY(); ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX ); - (*mpStm) << (INT32) 2540 << (INT32) 2540; + m_rStm << (INT32) 2540 << (INT32) 2540; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETVIEWPORTORGEX ); - (*mpStm) << (INT32) 0 << (INT32) 0; + m_rStm << (INT32) 0 << (INT32) 0; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETWINDOWORGEX ); - (*mpStm) << (INT32) 0 << (INT32) 0; + m_rStm << (INT32) 0 << (INT32) 0; ImplEndRecord(); ImplWriteRasterOp( ROP_OVERPAINT ); ImplBeginRecord( WIN_EMR_SETBKMODE ); - (*mpStm) << (UINT32) 1; // TRANSPARENT + m_rStm << (UINT32) 1; // TRANSPARENT ImplEndRecord(); // write emf data ImplWrite( rMtf ); ImplBeginRecord( WIN_EMR_EOF ); - (*mpStm)<< (sal_uInt32)0 // nPalEntries + m_rStm<< (sal_uInt32)0 // nPalEntries << (sal_uInt32)0x10 // offPalEntries << (sal_uInt32)0x14; // nSizeLast ImplEndRecord(); // write header - const ULONG nEndPos = mpStm->Tell(); mpStm->Seek( nHeaderPos ); + const ULONG nEndPos = m_rStm.Tell(); m_rStm.Seek( nHeaderPos ); - (*mpStm) << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object + m_rStm << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 ) << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 ) << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos ) @@ -246,10 +245,10 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (INT32) ( aMtfSizeLog.Width() * 10 ) << (INT32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object - mpStm->Seek( nEndPos ); + m_rStm.Seek( nEndPos ); delete[] mpHandlesUsed; - return( mpStm->GetError() == ERRCODE_NONE ); + return( m_rStm.GetError() == ERRCODE_NONE ); } // ----------------------------------------------------------------------------- @@ -290,10 +289,10 @@ void EMFWriter::ImplBeginRecord( sal_uInt32 nType ) if( !mbRecordOpen ) { mbRecordOpen = TRUE; - mnRecordPos = mpStm->Tell(); + mnRecordPos = m_rStm.Tell(); - (*mpStm) << nType; - mpStm->SeekRel( 4 ); + m_rStm << nType; + m_rStm.SeekRel( 4 ); } } @@ -305,16 +304,16 @@ void EMFWriter::ImplEndRecord() if( mbRecordOpen ) { - sal_Int32 nFillBytes, nActPos = mpStm->Tell(); - mpStm->Seek( mnRecordPos + 4 ); + sal_Int32 nFillBytes, nActPos = m_rStm.Tell(); + m_rStm.Seek( mnRecordPos + 4 ); nFillBytes = nActPos - mnRecordPos; nFillBytes += 3; // each record has to be dword aligned nFillBytes ^= 3; nFillBytes &= 3; - *mpStm << (sal_uInt32)( ( nActPos - mnRecordPos ) + nFillBytes ); - mpStm->Seek( nActPos ); + m_rStm << (sal_uInt32)( ( nActPos - mnRecordPos ) + nFillBytes ); + m_rStm.Seek( nActPos ); while( nFillBytes-- ) - *mpStm << (sal_uInt8)0; + m_rStm << (sal_uInt8)0; mnRecordCount++; mbRecordOpen = FALSE; } @@ -337,12 +336,12 @@ BOOL EMFWriter::ImplPrepareHandleSelect( sal_uInt32& rHandle, ULONG nSelectType // select stock object first ImplBeginRecord( WIN_EMR_SELECTOBJECT ); - ( *mpStm ) << nStockObject; + m_rStm << nStockObject; ImplEndRecord(); // destroy handle of created object ImplBeginRecord( WIN_EMR_DELETEOBJECT ); - ( *mpStm ) << rHandle; + m_rStm << rHandle; ImplEndRecord(); // mark handle as free @@ -364,12 +363,12 @@ void EMFWriter::ImplCheckLineAttr() sal_uInt32 nWidth = 0, nHeight = 0; ImplBeginRecord( WIN_EMR_CREATEPEN ); - (*mpStm) << mnLineHandle << nStyle << nWidth << nHeight; + m_rStm << mnLineHandle << nStyle << nWidth << nHeight; ImplWriteColor( maVDev.GetLineColor() ); ImplEndRecord(); ImplBeginRecord( WIN_EMR_SELECTOBJECT ); - (*mpStm) << mnLineHandle; + m_rStm << mnLineHandle; ImplEndRecord(); } } @@ -384,13 +383,13 @@ void EMFWriter::ImplCheckFillAttr() sal_uInt32 nPatternStyle = 0; ImplBeginRecord( WIN_EMR_CREATEBRUSHINDIRECT ); - (*mpStm) << mnFillHandle << nStyle; + m_rStm << mnFillHandle << nStyle; ImplWriteColor( maVDev.GetFillColor() ); - (*mpStm) << nPatternStyle; + m_rStm << nPatternStyle; ImplEndRecord(); ImplBeginRecord( WIN_EMR_SELECTOBJECT ); - (*mpStm) << mnFillHandle; + m_rStm << mnFillHandle; ImplEndRecord(); } } @@ -408,10 +407,10 @@ void EMFWriter::ImplCheckTextAttr() sal_uInt8 nPitchAndFamily; ImplBeginRecord( WIN_EMR_EXTCREATEFONTINDIRECTW ); - (*mpStm) << mnTextHandle; + m_rStm << mnTextHandle; ImplWriteExtent( -rFont.GetSize().Height() ); ImplWriteExtent( rFont.GetSize().Width() ); - (*mpStm) << (INT32) rFont.GetOrientation() << (INT32) rFont.GetOrientation(); + m_rStm << (INT32) rFont.GetOrientation() << (INT32) rFont.GetOrientation(); switch( rFont.GetWeight() ) { @@ -428,12 +427,12 @@ void EMFWriter::ImplCheckTextAttr() default: nWeight = 0; break; } - (*mpStm) << nWeight; - (*mpStm) << (BYTE) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 ); - (*mpStm) << (BYTE) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 ); - (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; + m_rStm << nWeight; + m_rStm << (BYTE) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 ); + m_rStm << (BYTE) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 ); + m_rStm << (BYTE) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 ); + m_rStm << (BYTE) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 ); + m_rStm << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; switch( rFont.GetPitch() ) { @@ -452,33 +451,33 @@ void EMFWriter::ImplCheckTextAttr() default: break; } - (*mpStm) << nPitchAndFamily; + m_rStm << nPitchAndFamily; for( i = 0; i < 32; i++ ) - (*mpStm) << (sal_Unicode) ( ( i < aFontName.Len() ) ? aFontName.GetChar( i ) : 0 ); + m_rStm << (sal_Unicode) ( ( i < aFontName.Len() ) ? aFontName.GetChar( i ) : 0 ); // dummy elfFullName for( i = 0; i < 64; i++ ) - (*mpStm) << (sal_Unicode) 0; + m_rStm << (sal_Unicode) 0; // dummy elfStyle for( i = 0; i < 32; i++ ) - (*mpStm) << (sal_Unicode) 0; + m_rStm << (sal_Unicode) 0; // dummy elfVersion, elfStyleSize, elfMatch, elfReserved - (*mpStm) << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 ; + m_rStm << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 ; // dummy elfVendorId - (*mpStm) << (UINT32) 0; + m_rStm << (UINT32) 0; // dummy elfCulture - (*mpStm) << (UINT32) 0; + m_rStm << (UINT32) 0; // dummy elfPanose - (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; + m_rStm << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0; // fill record to get a record size divideable by 4 - (*mpStm) << (UINT16) 0; + m_rStm << (UINT16) 0; ImplEndRecord(); @@ -494,7 +493,7 @@ void EMFWriter::ImplCheckTextAttr() nTextAlign |= mnHorTextAlign; ImplBeginRecord( WIN_EMR_SETTEXTALIGN ); - (*mpStm) << nTextAlign; + m_rStm << nTextAlign; ImplEndRecord(); // Text color @@ -503,7 +502,7 @@ void EMFWriter::ImplCheckTextAttr() ImplEndRecord(); ImplBeginRecord( WIN_EMR_SELECTOBJECT ); - (*mpStm) << mnTextHandle; + m_rStm << mnTextHandle; ImplEndRecord(); } } @@ -517,7 +516,7 @@ void EMFWriter::ImplWriteColor( const Color& rColor ) nCol |= ( (UINT32) rColor.GetGreen() ) << 8; nCol |= ( (UINT32) rColor.GetBlue() ) << 16; - (*mpStm) << nCol; + m_rStm << nCol; } // ----------------------------------------------------------------------------- @@ -534,7 +533,7 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop ) } ImplBeginRecord( WIN_EMR_SETROP2 ); - (*mpStm) << nROP2; + m_rStm << nROP2; ImplEndRecord(); } @@ -543,7 +542,7 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop ) void EMFWriter::ImplWriteExtent( long nExtent ) { nExtent = maVDev.LogicToLogic( Size( nExtent, 0 ), maVDev.GetMapMode(), maDestMapMode ).Width(); - (*mpStm) << (INT32) nExtent; + m_rStm << (INT32) nExtent; } // ----------------------------------------------------------------------------- @@ -551,7 +550,7 @@ void EMFWriter::ImplWriteExtent( long nExtent ) void EMFWriter::ImplWritePoint( const Point& rPoint ) { const Point aPoint( maVDev.LogicToLogic( rPoint, maVDev.GetMapMode(), maDestMapMode )); - (*mpStm) << (INT32) aPoint.X() << (INT32) aPoint.Y(); + m_rStm << (INT32) aPoint.X() << (INT32) aPoint.Y(); } // ----------------------------------------------------------------------------- @@ -559,7 +558,7 @@ void EMFWriter::ImplWritePoint( const Point& rPoint ) void EMFWriter::ImplWriteSize( const Size& rSize) { const Size aSize( maVDev.LogicToLogic( rSize, maVDev.GetMapMode(), maDestMapMode )); - (*mpStm) << (INT32) aSize.Width() << (INT32) aSize.Height(); + m_rStm << (INT32) aSize.Width() << (INT32) aSize.Height(); } // ----------------------------------------------------------------------------- @@ -567,7 +566,7 @@ void EMFWriter::ImplWriteSize( const Size& rSize) void EMFWriter::ImplWriteRect( const Rectangle& rRect ) { const Rectangle aRect( maVDev.LogicToLogic ( rRect, maVDev.GetMapMode(), maDestMapMode )); - (*mpStm) << aRect.Left() << aRect.Top() << aRect.Right() << aRect.Bottom(); + m_rStm << aRect.Left() << aRect.Top() << aRect.Right() << aRect.Bottom(); } // ----------------------------------------------------------------------------- @@ -587,7 +586,7 @@ void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose ) ImplBeginRecord( bClose ? WIN_EMR_POLYGON : WIN_EMR_POLYLINE ); ImplWriteRect( rPoly.GetBoundRect() ); - (*mpStm) << (UINT32) rPoly.GetSize(); + m_rStm << (UINT32) rPoly.GetSize(); for( USHORT i = 0; i < rPoly.GetSize(); i++ ) ImplWritePoint( rPoly[ i ] ); @@ -629,10 +628,10 @@ void EMFWriter::ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly ) ImplBeginRecord( WIN_EMR_POLYPOLYGON ); ImplWriteRect( rPolyPoly.GetBoundRect() ); - (*mpStm) << (sal_uInt32)nPolyCount << nTotalPoints; + m_rStm << (sal_uInt32)nPolyCount << nTotalPoints; for( i = 0; i < nPolyCount; i++ ) - (*mpStm) << (sal_uInt32)rPolyPoly[ i ].GetSize(); + m_rStm << (sal_uInt32)rPolyPoly[ i ].GetSize(); for( i = 0; i < nPolyCount; i++ ) { @@ -688,7 +687,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed ) for ( o = 0; o < nBezPoints; o++ ) aNewPoly[ o + 1 ] = rPoly[ n + o ]; ImplWriteRect( aNewPoly.GetBoundRect() ); - (*mpStm) << (sal_uInt32)nBezPoints; + m_rStm << (sal_uInt32)nBezPoints; for( o = 1; o < aNewPoly.GetSize(); o++ ) ImplWritePoint( aNewPoly[ o ] ); ImplEndRecord(); @@ -708,7 +707,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed ) for ( o = 1; o <= nPoints; o++ ) aNewPoly[ o ] = rPoly[ n - 1 + o ]; ImplWriteRect( aNewPoly.GetBoundRect() ); - (*mpStm) << (sal_uInt32)( nPoints ); + m_rStm << (sal_uInt32)( nPoints ); for( o = 1; o < aNewPoly.GetSize(); o++ ) ImplWritePoint( aNewPoly[ o ] ); ImplEndRecord(); @@ -748,13 +747,13 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, ImplBeginRecord( WIN_EMR_STRETCHDIBITS ); ImplWriteRect( Rectangle( rPt, rSz ) ); ImplWritePoint( rPt ); - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) aBmpSizePixel.Width() << (INT32) aBmpSizePixel.Height(); + m_rStm << (INT32) 0 << (INT32) 0 << (INT32) aBmpSizePixel.Width() << (INT32) aBmpSizePixel.Height(); // write offset positions and sizes later - const ULONG nOffPos = mpStm->Tell(); - mpStm->SeekRel( 16 ); + const ULONG nOffPos = m_rStm.Tell(); + m_rStm.SeekRel( 16 ); - (*mpStm) << (UINT32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); + m_rStm << (UINT32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP ); ImplWriteSize( rSz ); rBmp.Write( aMemStm, TRUE, FALSE ); @@ -773,13 +772,13 @@ void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (UINT32) nBitCount ) ) : ( ( 3 == nCompression ) ? 12 : 0 ); - mpStm->Write( aMemStm.GetData(), nDIBSize ); + m_rStm.Write( aMemStm.GetData(), nDIBSize ); - const ULONG nEndPos = mpStm->Tell(); - mpStm->Seek( nOffPos ); - (*mpStm) << (UINT32) 80 << (UINT32)( nHeaderSize + ( nPalCount << 2 ) ); - (*mpStm) << (UINT32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize; - mpStm->Seek( nEndPos ); + const ULONG nEndPos = m_rStm.Tell(); + m_rStm.Seek( nOffPos ); + m_rStm << (UINT32) 80 << (UINT32)( nHeaderSize + ( nPalCount << 2 ) ); + m_rStm << (UINT32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize; + m_rStm.Seek( nEndPos ); ImplEndRecord(); } @@ -828,20 +827,20 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons ImplBeginRecord( WIN_EMR_EXTTEXTOUTW ); ImplWriteRect( Rectangle( rPos, Size( nNormWidth, maVDev.GetTextHeight() ) ) ); - (*mpStm) << (UINT32)1; - (*mpStm) << (INT32) 0 << (INT32) 0; + m_rStm << (UINT32)1; + m_rStm << (INT32) 0 << (INT32) 0; ImplWritePoint( rPos ); - (*mpStm) << (UINT32) nLen << (UINT32) 76 << (UINT32) 2; - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) 0 << (INT32) 0; - (*mpStm) << (UINT32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ); + m_rStm << (UINT32) nLen << (UINT32) 76 << (UINT32) 2; + m_rStm << (INT32) 0 << (INT32) 0 << (INT32) 0 << (INT32) 0; + m_rStm << (UINT32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) ); // write text for( i = 0; i < nLen; i++ ) - (*mpStm) << (sal_Unicode)rText.GetChar( i ); + m_rStm << (sal_Unicode)rText.GetChar( i ); // padding word if( nLen & 1 ) - (*mpStm) << (UINT16) 0; + m_rStm << (UINT16) 0; // write DX array ImplWriteExtent( pDX[ 0 ] ); @@ -1176,7 +1175,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) maVDev.Pop(); ImplBeginRecord( WIN_EMR_RESTOREDC ); - (*mpStm) << (INT32) -1; + m_rStm << (INT32) -1; ImplEndRecord(); break; } @@ -1366,7 +1365,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) ( (MetaAction*) pAction )->Execute( &maVDev ); ImplBeginRecord( WIN_EMR_RESTOREDC ); - (*mpStm) << (INT32) -1; + m_rStm << (INT32) -1; ImplEndRecord(); ImplWriteRasterOp( maVDev.GetRasterOp() ); diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx index d95176aef406..fbee680b1cd0 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.hxx +++ b/svtools/source/filter.vcl/wmf/emfwr.hxx @@ -50,7 +50,7 @@ private: VirtualDevice maVDev; MapMode maDestMapMode; FilterConfigItem* mpFilterConfigItem; - SvStream* mpStm; + SvStream& m_rStm; BOOL* mpHandlesUsed; ULONG mnHandleCount; ULONG mnLastPercent; @@ -93,9 +93,9 @@ private: public: - EMFWriter() {} + EMFWriter(SvStream &rStream) : m_rStm(rStream) {} - BOOL WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfigItem* pConfigItem = NULL ); + BOOL WriteEMF( const GDIMetaFile& rMtf, FilterConfigItem* pConfigItem = NULL ); }; #endif // _EMFWR_HXX diff --git a/svtools/source/filter.vcl/wmf/wmf.cxx b/svtools/source/filter.vcl/wmf/wmf.cxx index 035eaf9e5225..b56d9d07cc28 100644 --- a/svtools/source/filter.vcl/wmf/wmf.cxx +++ b/svtools/source/filter.vcl/wmf/wmf.cxx @@ -96,8 +96,8 @@ BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem ) { - EMFWriter aEMFWriter; - return aEMFWriter.WriteEMF( rMTF, rTargetStream, pConfigItem ); + EMFWriter aEMFWriter(rTargetStream); + return aEMFWriter.WriteEMF( rMTF, pConfigItem ); } // ----------------------------------------------------------------------------- diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx index 269fbb4fe877..bc49793097c8 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.cxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx @@ -2014,10 +2014,10 @@ USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode, void WMFWriter::WriteEmbeddedEMF( const GDIMetaFile& rMTF ) { - EMFWriter aEMFWriter; SvMemoryStream aStream; + EMFWriter aEMFWriter(aStream); - if( aEMFWriter.WriteEMF( rMTF, aStream ) ) + if( aEMFWriter.WriteEMF( rMTF ) ) { sal_Size nTotalSize = aStream.Tell(); if( nTotalSize > SAL_MAX_UINT32 ) |