diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-11-17 13:19:16 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-11-17 15:08:43 +0100 |
commit | 129629de708b35154a0812eaf19dd19e76e38331 (patch) | |
tree | d85ccc007fb63956f43ed7deb22f0ff10b0875b3 | |
parent | 9536098ff107f1096e7f710c6f1e76c5659a5482 (diff) |
Don't use new/delete here when automatic variable is enough
Change-Id: Ia119da3b54fd957f3316637ddaa047cfd6a399fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105994
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 8ffa24994ebb..02f47b5c6bba 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2745,22 +2745,21 @@ SvStream& GDIMetaFile::Read( SvStream& rIStm ) SvStream& GDIMetaFile::Write( SvStream& rOStm ) { - VersionCompat* pCompat; const SvStreamCompressFlags nStmCompressMode = rOStm.GetCompressMode(); SvStreamEndian nOldFormat = rOStm.GetEndian(); rOStm.SetEndian( SvStreamEndian::LITTLE ); rOStm.WriteBytes( "VCLMTF", 6 ); - pCompat = new VersionCompat( rOStm, StreamMode::WRITE, 1 ); - - rOStm.WriteUInt32( static_cast<sal_uInt32>(nStmCompressMode) ); - WriteMapMode( rOStm, m_aPrefMapMode ); - TypeSerializer aSerializer(rOStm); - aSerializer.writeSize(m_aPrefSize); - rOStm.WriteUInt32( GetActionSize() ); - - delete pCompat; + { + VersionCompat aCompat(rOStm, StreamMode::WRITE, 1); + + rOStm.WriteUInt32(static_cast<sal_uInt32>(nStmCompressMode)); + WriteMapMode(rOStm, m_aPrefMapMode); + TypeSerializer aSerializer(rOStm); + aSerializer.writeSize(m_aPrefSize); + rOStm.WriteUInt32(GetActionSize()); + } // VersionCompat dtor writes stuff into the header ImplMetaWriteData aWriteData; |