summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/pdfwriter_impl.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-21 14:24:11 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-21 15:30:17 +0200
commit0696dd9a3d3f3aead4c8cc350eb48cb955173adb (patch)
tree58d29371bc42a9cec63fc18f3620209941394571 /vcl/source/gdi/pdfwriter_impl.cxx
parent47169087c176a419cf4382e3bdb23b39df1575cd (diff)
ZCodec instances can be allocated on the stack just fine
Change-Id: I523fba14c721815f8416f6e0224e42052d13429a
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.cxx')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx19
1 files changed, 9 insertions, 10 deletions
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