summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-01-23 21:28:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 19:30:45 +0100
commit7589e8413411aa4e0bf437ec0a7080c577a9c1d9 (patch)
tree23903d683565debb5e32105846f2eea2bfd7b6ca /vcl
parentdcf6eb790761028ada2e285f879d56271d9bc457 (diff)
no need for these to be heap-allocated
Change-Id: I50a4350198e3c2b8eb669b43fb40e4b01dcb67ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/impgraph.cxx20
-rw-r--r--vcl/source/treelist/imap.cxx4
2 files changed, 12 insertions, 12 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 0591606dba86..067497301e02 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1263,7 +1263,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
if( GRAPHIC_FORMAT_50 == nId )
{
// read new style header
- std::unique_ptr<VersionCompat> pCompat( new VersionCompat( rIStm, StreamMode::READ ) );
+ VersionCompat aCompat( rIStm, StreamMode::READ );
rIStm.ReadInt32( nType );
sal_Int32 nLen;
@@ -1401,7 +1401,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
rOStm.WriteUInt32( GRAPHIC_FORMAT_50 );
// write new style header
- std::unique_ptr<VersionCompat> pCompat( new VersionCompat( rOStm, StreamMode::WRITE, 1 ) );
+ VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 );
rOStm.WriteInt32( static_cast<sal_Int32>(meType) );
@@ -1792,10 +1792,10 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
Graphic aGraphic;
GfxLink aLink;
- // read compat info
- std::unique_ptr<VersionCompat> pCompat(new VersionCompat( rIStm, StreamMode::READ ));
- pCompat.reset(); // destructor writes stuff into the header
-
+ // read compat info, destructor writes stuff into the header
+ {
+ VersionCompat aCompat( rIStm, StreamMode::READ );
+ }
ReadGfxLink( rIStm, aLink );
// set dummy link to avoid creation of additional link after filtering;
@@ -1967,10 +1967,10 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic)
// native format
rOStm.WriteUInt32( NATIVE_FORMAT_50 );
- // write compat info
- std::unique_ptr<VersionCompat> pCompat(new VersionCompat( rOStm, StreamMode::WRITE, 1 ));
- pCompat.reset(); // destructor writes stuff into the header
-
+ // write compat info, destructor writes stuff into the header
+ {
+ VersionCompat aCompat( rOStm, StreamMode::WRITE, 1 );
+ }
rImpGraphic.mpGfxLink->SetPrefMapMode( rImpGraphic.ImplGetPrefMapMode() );
rImpGraphic.mpGfxLink->SetPrefSize( rImpGraphic.ImplGetPrefSize() );
WriteGfxLink( rOStm, *rImpGraphic.mpGfxLink );
diff --git a/vcl/source/treelist/imap.cxx b/vcl/source/treelist/imap.cxx
index 536c9c819a8f..3c08c220d3fc 100644
--- a/vcl/source/treelist/imap.cxx
+++ b/vcl/source/treelist/imap.cxx
@@ -79,7 +79,7 @@ void IMapObject::Write( SvStream& rOStm ) const
rOStm.WriteBool( bActive );
write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aTarget, eEncoding);
- std::unique_ptr<IMapCompat> pCompat(new IMapCompat( rOStm, StreamMode::WRITE ));
+ IMapCompat aCompat( rOStm, StreamMode::WRITE );
WriteIMapObject( rOStm );
aEventList.Write( rOStm ); // V4
@@ -108,7 +108,7 @@ void IMapObject::Read( SvStream& rIStm )
// make URL absolute
aURL = URIHelper::SmartRel2Abs( INetURLObject(""), aURL, URIHelper::GetMaybeFileHdl(), true, false, INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism::Unambiguous );
- std::unique_ptr<IMapCompat> pCompat(new IMapCompat( rIStm, StreamMode::READ ));
+ IMapCompat aCompat( rIStm, StreamMode::READ );
ReadIMapObject( rIStm );