From 0696dd9a3d3f3aead4c8cc350eb48cb955173adb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 21 May 2014 14:24:11 +0200 Subject: ZCodec instances can be allocated on the stack just fine Change-Id: I523fba14c721815f8416f6e0224e42052d13429a --- vcl/source/gdi/pdfwriter_impl.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'vcl/source/gdi/pdfwriter_impl.cxx') diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 2906bb2690c9..4e7687cc7925 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2086,12 +2086,12 @@ bool PDFWriterImpl::compressStream( SvMemoryStream* pStream ) pStream->Seek( STREAM_SEEK_TO_END ); sal_uLong nEndPos = pStream->Tell(); pStream->Seek( STREAM_SEEK_TO_BEGIN ); - ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 ); + ZCodec pCodec( 0x4000, 0x4000 ); SvMemoryStream aStream; - pCodec->BeginCompression(); - pCodec->Write( aStream, (const sal_uInt8*)pStream->GetData(), nEndPos ); - pCodec->EndCompression(); - delete pCodec; + pCodec.BeginCompression(); + pCodec.Write( aStream, (const sal_uInt8*)pStream->GetData(), nEndPos ); + pCodec.EndCompression(); + assert(false); nEndPos = aStream.Tell(); pStream->Seek( STREAM_SEEK_TO_BEGIN ); aStream.Seek( STREAM_SEEK_TO_BEGIN ); @@ -3701,12 +3701,11 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding, "end\n" "end\n" ); #ifndef DEBUG_DISABLE_PDFCOMPRESSION - ZCodec* pCodec = new ZCodec( 0x4000, 0x4000 ); + ZCodec pCodec( 0x4000, 0x4000 ); SvMemoryStream aStream; - pCodec->BeginCompression(); - pCodec->Write( aStream, (const sal_uInt8*)aContents.getStr(), aContents.getLength() ); - pCodec->EndCompression(); - delete pCodec; + pCodec.BeginCompression(); + pCodec.Write( aStream, (const sal_uInt8*)aContents.getStr(), aContents.getLength() ); + pCodec.EndCompression(); #endif #if OSL_DEBUG_LEVEL > 1 -- cgit v1.2.3