summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-23 10:45:31 +0200
committerNoel Grandin <noel@peralex.com>2016-03-23 10:46:06 +0200
commitd4163c17ef47fdbc7d45adc5803b9844739b3324 (patch)
treef12436a94ddf474b59456844d9f864ad3bb548a1
parent1e2078d45161c306f4a8dda97b2ddde57e5e7471 (diff)
tdf#98600 and tdf#98622 fix metafile parsing (part2)
more regressions from commit db17d3c1 "new loplugin: memoryvar" Change-Id: I611697f2bc818f2f42a704bfb5297637c30060c9
-rw-r--r--vcl/source/gdi/gdimtf.cxx2
-rw-r--r--vcl/source/gdi/gfxlink.cxx4
-rw-r--r--vcl/source/gdi/impgraph.cxx2
3 files changed, 7 insertions, 1 deletions
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 4920f90dfb39..54252ab4fb3c 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2772,7 +2772,7 @@ SvStream& ReadGDIMetaFile( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
ReadPair( rIStm, rGDIMetaFile.aPrefSize );
rIStm.ReadUInt32( nCount );
- pCompat.reset(); // needs to be deleted here for the parsing to work correctly
+ pCompat.reset(); // destructor writes stuff into the header
ImplMetaReadData aReadData;
aReadData.meActualCharSet = rIStm.GetStreamCharSet();
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index dd3b02317a99..266c8a46681d 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -251,6 +251,8 @@ SvStream& WriteGfxLink( SvStream& rOStream, const GfxLink& rGfxLink )
WritePair( rOStream, rGfxLink.GetPrefSize() );
WriteMapMode( rOStream, rGfxLink.GetPrefMapMode() );
+ pCompat.reset(); // destructor writes stuff into the header
+
if( rGfxLink.GetDataSize() )
{
if( rGfxLink.IsSwappedOut() )
@@ -283,6 +285,8 @@ SvStream& ReadGfxLink( SvStream& rIStream, GfxLink& rGfxLink)
bMapAndSizeValid = true;
}
+ pCompat.reset(); // destructor writes stuff into the header
+
pBuf = new sal_uInt8[ nSize ];
rIStream.Read( pBuf, nSize );
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index e6f0f77f9eda..7abbb650679f 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1454,6 +1454,7 @@ SvStream& ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
// read compat info
std::unique_ptr<VersionCompat> pCompat(new VersionCompat( rIStm, StreamMode::READ ));
+ pCompat.reset(); // destructor writes stuff into the header
ReadGfxLink( rIStm, aLink );
@@ -1594,6 +1595,7 @@ SvStream& WriteImpGraphic( SvStream& rOStm, const ImpGraphic& rImpGraphic )
// write compat info
std::unique_ptr<VersionCompat> pCompat(new VersionCompat( rOStm, StreamMode::WRITE, 1 ));
+ pCompat.reset(); // destructor writes stuff into the header
rImpGraphic.mpGfxLink->SetPrefMapMode( rImpGraphic.ImplGetPrefMapMode() );
rImpGraphic.mpGfxLink->SetPrefSize( rImpGraphic.ImplGetPrefSize() );