[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/source

Noel Grandin noel at peralex.com
Thu Mar 24 10:26:11 UTC 2016


 vcl/source/gdi/gdimtf.cxx   |    2 +-
 vcl/source/gdi/gfxlink.cxx  |    4 ++++
 vcl/source/gdi/impgraph.cxx |    2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit e3d06146f648faf35b475d536f3a9c6fd55ea188
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Mar 23 10:45:31 2016 +0200

    tdf#98600 and tdf#98622 fix metafile parsing (part2)
    
    more regressions from commit db17d3c1 "new loplugin: memoryvar"
    
    Change-Id: I611697f2bc818f2f42a704bfb5297637c30060c9
    (cherry picked from commit d4163c17ef47fdbc7d45adc5803b9844739b3324)
    Reviewed-on: https://gerrit.libreoffice.org/23470
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 581fa51..f14ed8e 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2763,7 +2763,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 f841360..8d7a503 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -261,6 +261,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() )
@@ -293,6 +295,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 d77d1b0..5179afa 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1447,6 +1447,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 );
 
@@ -1587,6 +1588,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() );


More information about the Libreoffice-commits mailing list