[Libreoffice-commits] core.git: filter/source svx/source vcl/source

panoskorovesis (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 13 04:21:53 UTC 2021


 filter/source/svg/svgwriter.cxx   |    4 +++-
 svx/source/gallery2/galobj.cxx    |    4 +++-
 vcl/source/gdi/TypeSerializer.cxx |    4 +++-
 vcl/source/gdi/impgraph.cxx       |    4 +++-
 vcl/source/gdi/metaact.cxx        |    7 +++++--
 vcl/source/gdi/svmconverter.cxx   |    4 +++-
 vcl/source/treelist/transfer.cxx  |   10 +++++++---
 7 files changed, 27 insertions(+), 10 deletions(-)

New commits:
commit be710c72a6302829bf7f632c8ad6dc72be51fd95
Author:     panoskorovesis <panoskorovesis at outlook.com>
AuthorDate: Thu Aug 5 15:41:48 2021 +0300
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Aug 13 06:21:19 2021 +0200

    Replace ReadGDIMetaFile with SvmReader::Read
    
    Use the new Read functionality
    
    Change-Id: Ied997377fda8793422b1c8877ece705e4a9b6dbd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120376
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index eefbbc61859a..17401fdd2370 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -29,6 +29,7 @@
 #include <vcl/metric.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/filter/SvmReader.hxx>
 #include <tools/fract.hxx>
 #include <tools/helpers.hxx>
 #include <tools/stream.hxx>
@@ -4002,7 +4003,8 @@ void SAL_CALL SVGWriter::write( const Reference<XDocumentHandler>& rxDocHandler,
     SvMemoryStream  aMemStm( const_cast<sal_Int8 *>(rMtfSeq.getConstArray()), rMtfSeq.getLength(), StreamMode::READ );
     GDIMetaFile     aMtf;
 
-    ReadGDIMetaFile( aMemStm, aMtf );
+    SvmReader aReader( aMemStm );
+    aReader.Read( aMtf );
 
     rtl::Reference<SVGExport> pWriter(new SVGExport( mxContext, rxDocHandler, maFilterData ));
     pWriter->writeMtf( aMtf );
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 107d32da0750..80c81063d951 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -32,6 +32,7 @@
 #include <svx/galmisc.hxx>
 #include <galobj.hxx>
 #include <vcl/dibtools.hxx>
+#include <vcl/filter/SvmReader.hxx>
 #include "gallerydrawmodel.hxx"
 #include <bitmaps.hlst>
 
@@ -212,7 +213,8 @@ void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion )
     }
     else
     {
-        ReadGDIMetaFile( rIn, aThumbMtf );
+        SvmReader aReader( rIn );
+        aReader.Read( aThumbMtf );
     }
 
     OUString aTmpStr = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
diff --git a/vcl/source/gdi/TypeSerializer.cxx b/vcl/source/gdi/TypeSerializer.cxx
index 4fc05ec5c5d7..6f88b1954e25 100644
--- a/vcl/source/gdi/TypeSerializer.cxx
+++ b/vcl/source/gdi/TypeSerializer.cxx
@@ -22,6 +22,7 @@
 #include <tools/fract.hxx>
 #include <sal/log.hxx>
 #include <comphelper/fileformat.h>
+#include <vcl/filter/SvmReader.hxx>
 #include <vcl/gdimtf.hxx>
 #include <vcl/dibtools.hxx>
 
@@ -255,7 +256,8 @@ void TypeSerializer::readGraphic(Graphic& rGraphic)
 
             mrStream.Seek(nInitialStreamPosition);
             mrStream.ResetError();
-            ReadGDIMetaFile(mrStream, aMetaFile);
+            SvmReader aReader(mrStream);
+            aReader.Read(aMetaFile);
 
             if (!mrStream.GetError())
             {
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 2aa4763ad256..242e1d22e49e 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -31,6 +31,7 @@
 #include <unotools/ucbhelper.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include <unotools/tempfile.hxx>
+#include <vcl/filter/SvmReader.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/graphicfilter.hxx>
 #include <vcl/virdev.hxx>
@@ -1675,7 +1676,8 @@ bool ImpGraphic::swapInGraphic(SvStream& rStream)
     else if (meType == GraphicType::GdiMetafile)
     {
         GDIMetaFile aMetaFile;
-        ReadGDIMetaFile(rStream, aMetaFile);
+        SvmReader aReader(rStream);
+        aReader.Read(aMetaFile);
         if (!rStream.GetError())
         {
             maMetaFile = aMetaFile;
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 8f119e569b0a..0685f939683f 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -25,6 +25,7 @@
 #include <tools/vcompat.hxx>
 #include <tools/helpers.hxx>
 #include <vcl/dibtools.hxx>
+#include <vcl/filter/SvmReader.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/metaact.hxx>
 #include <vcl/graphictools.hxx>
@@ -3032,7 +3033,8 @@ void MetaFloatTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pDat
 void MetaFloatTransparentAction::Read(SvStream& rIStm, ImplMetaReadData* pData)
 {
     VersionCompatRead aCompat(rIStm);
-    ReadGDIMetaFile(rIStm, maMtf, pData);
+    SvmReader aReader(rIStm);
+    aReader.Read(maMtf, pData);
     TypeSerializer aSerializer(rIStm);
     aSerializer.readPoint(maPoint);
     aSerializer.readSize(maSize);
@@ -3097,7 +3099,8 @@ void MetaEPSAction::Read( SvStream& rIStm, ImplMetaReadData* )
     aSerializer.readGfxLink(maGfxLink);
     aSerializer.readPoint(maPoint);
     aSerializer.readSize(maSize);
-    ReadGDIMetaFile( rIStm, maSubst );
+    SvmReader aReader(rIStm);
+    aReader.Read(maSubst);
 }
 
 MetaRefPointAction::MetaRefPointAction() :
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 5da460b8174f..2ef2e35522d0 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -25,6 +25,7 @@
 #include <tools/fract.hxx>
 #include <tools/stream.hxx>
 #include <vcl/dibtools.hxx>
+#include <vcl/filter/SvmReader.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/lineinfo.hxx>
 #include <vcl/metaact.hxx>
@@ -1088,7 +1089,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
                 Gradient    aGradient;
                 sal_Int32   nFollowingActionCount(0);
 
-                ReadGDIMetaFile( rIStm, aMtf );
+                SvmReader aReader( rIStm );
+                aReader.Read( aMtf );
                 aSerializer.readPoint(aPos);
                 aSerializer.readSize(aSize);
                 aSerializer.readGradient(aGradient);
diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx
index b43b220856bc..99f76a0ce78e 100644
--- a/vcl/source/treelist/transfer.cxx
+++ b/vcl/source/treelist/transfer.cxx
@@ -31,6 +31,7 @@
 #include <sot/exchange.hxx>
 #include <sot/storage.hxx>
 #include <vcl/bitmap.hxx>
+#include <vcl/filter/SvmReader.hxx>
 #include <vcl/gdimtf.hxx>
 #include <vcl/graph.hxx>
 #include <vcl/cvtgrf.hxx>
@@ -335,7 +336,8 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co
                         GDIMetaFile     aMtf;
                         {
                             SvMemoryStream aSrcStm( aSeq.getArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC );
-                            ReadGDIMetaFile( aSrcStm, aMtf );
+                            SvmReader aReader( aSrcStm );
+                            aReader.Read( aMtf );
                         }
 
                         Graphic         aGraphic( aMtf );
@@ -365,7 +367,8 @@ Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, co
                         GDIMetaFile     aMtf;
                         {
                             SvMemoryStream aSrcStm( aSeq.getArray(), aSeq.getLength(), StreamMode::WRITE | StreamMode::TRUNC );
-                            ReadGDIMetaFile( aSrcStm, aMtf );
+                            SvmReader aReader( aSrcStm );
+                            aReader.Read( aMtf );
                         }
 
                         SvMemoryStream  aDstStm( 65535, 65535 );
@@ -1671,7 +1674,8 @@ bool TransferableDataHelper::GetGDIMetaFile( const DataFlavor& rFlavor, GDIMetaF
 
     if( GetSotStorageStream( rFlavor, xStm ) )
     {
-        ReadGDIMetaFile( *xStm, rMtf );
+        SvmReader aReader( *xStm );
+        aReader.Read( rMtf );
         bRet = ( xStm->GetError() == ERRCODE_NONE );
     }
 


More information about the Libreoffice-commits mailing list