diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-13 14:31:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-15 08:39:42 +0200 |
commit | bac46d18a2a46024bb5cdf2ffb59ef6e0c028744 (patch) | |
tree | 44af21f45f1c0fde48da4d4284fedde2366081a4 /vcl | |
parent | beb0637b4e1516b12dc934a177a58a2c53d2872f (diff) |
loplugin:useuniqueptr in TilingEmit
Change-Id: Idf591f6d8557f1477eec4f8d69358ff41d9acff3
Reviewed-on: https://gerrit.libreoffice.org/59016
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 7 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6a7bb3d91ea5..cb58e6ce8842 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2769,7 +2769,7 @@ bool PDFWriterImpl::emitTilings() if( tiling.m_aCellSize.Height() == 0 ) tiling.m_aCellSize.setHeight( nH ); - bool bDeflate = compressStream( tiling.m_pTilingStream ); + bool bDeflate = compressStream( tiling.m_pTilingStream.get() ); tiling.m_pTilingStream->Seek( STREAM_SEEK_TO_END ); sal_uInt64 const nTilingStreamSize = tiling.m_pTilingStream->Tell(); tiling.m_pTilingStream->Seek( STREAM_SEEK_TO_BEGIN ); @@ -2828,8 +2828,7 @@ bool PDFWriterImpl::emitTilings() if ( !writeBuffer( aTilingObj.getStr(), aTilingObj.getLength() ) ) return false; checkAndEnableStreamEncryption( tiling.m_nObject ); bool written = writeBuffer( tiling.m_pTilingStream->GetData(), nTilingStreamSize ); - delete tiling.m_pTilingStream; - tiling.m_pTilingStream = nullptr; + tiling.m_pTilingStream.reset(); if( !written ) return false; disableStreamEncryption(); @@ -10161,7 +10160,7 @@ void PDFWriterImpl::drawWallpaper( const tools::Rectangle& rRect, const Wallpape m_aTilings.emplace_back( ); m_aTilings.back().m_nObject = createObject(); m_aTilings.back().m_aRectangle = tools::Rectangle( Point( 0, 0 ), aConvertRect.GetSize() ); - m_aTilings.back().m_pTilingStream = new SvMemoryStream(); + m_aTilings.back().m_pTilingStream.reset(new SvMemoryStream()); m_aTilings.back().m_pTilingStream->WriteBytes( aTilingStream.getStr(), aTilingStream.getLength() ); // phase the tiling so wallpaper begins on upper left diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index b6d7a55d2aaf..acafb54f587e 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -282,11 +282,10 @@ public: Size m_aCellSize; SvtGraphicFill::Transform m_aTransform; ResourceDict m_aResources; - SvMemoryStream* m_pTilingStream; + std::unique_ptr<SvMemoryStream> m_pTilingStream; TilingEmit() - : m_nObject( 0 ), - m_pTilingStream( nullptr ) + : m_nObject( 0 ) {} }; |