diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-02 15:17:52 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-02 15:17:52 +0100 |
commit | 5595ee701eab0fef0683c93e3c99788ab1b08520 (patch) | |
tree | f65921d6b5b0c8c988fa37eb4dc57e2879d25bf2 /sfx2 | |
parent | 19c0eff34a5e1de4f3aff723b7750d4e01d4ba6d (diff) |
loplugin:useuniqueptr
Change-Id: I3a246a22baaac8195dc1b94c42994de7d80e8336
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/graphhelp.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 542c8ff4aef2..f6ab18cc1645 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -118,17 +118,17 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, co #ifdef _WIN32 if ( pGDIMeta ) { - SvMemoryStream* pStream = new SvMemoryStream( 65535, 65535 ); + SvMemoryStream pStream( 65535, 65535 ); Graphic aGraph( *pGDIMeta ); - bool bFailed = GraphicConverter::Export( *pStream, aGraph, ConvertDataFormat::WMF ); - pStream->Flush(); + bool bFailed = GraphicConverter::Export( pStream, aGraph, ConvertDataFormat::WMF ); + pStream.Flush(); if ( !bFailed ) { - sal_Int32 nLength = pStream->Seek( STREAM_SEEK_TO_END ); + sal_Int32 nLength = pStream.Seek( STREAM_SEEK_TO_END ); if ( nLength > 22 ) { HMETAFILE hMeta = SetMetaFileBitsEx( nLength - 22, - ( static_cast< const unsigned char*>( pStream->GetData() ) ) + 22 ); + ( static_cast< const unsigned char*>( pStream.GetData() ) ) + 22 ); if ( hMeta ) { @@ -166,8 +166,6 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, co } } } - - delete pStream; } #endif |