[Libreoffice-commits] core.git: emfio/source

Caolán McNamara caolanm at redhat.com
Wed Nov 1 19:11:15 UTC 2017


 emfio/source/reader/wmfreader.cxx |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit c4bac94488774c0d8b114075ee47307c96d017c2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 31 16:38:54 2017 +0000

    de-sal_uLong emfio
    
    Change-Id: If1fea844350446547c9f50d0316aedd50a3f4c25
    Reviewed-on: https://gerrit.libreoffice.org/44161
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index cecd93a82ac0..2cb5eeb3f6de 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -1332,7 +1332,6 @@ namespace emfio
     void WmfReader::ReadWMF()
     {
         sal_uInt16  nFunction;
-        sal_uLong   nPos;
 
         mnSkipActions = 0;
         mnCurrentAction = 0;
@@ -1352,7 +1351,7 @@ namespace emfio
 
         if ( ReadHeader( ) )
         {
-            nPos = mpInputStream->Tell();
+            auto nPos = mpInputStream->Tell();
 
             if( mnEndPos - mnStartPos )
             {
@@ -1452,10 +1451,8 @@ namespace emfio
         aBound.Bottom() = RECT_MIN;
         bool bBoundsDetermined = false;
 
-        sal_uInt32 nPos = pStm->Tell();
-        sal_uInt32 nEnd = pStm->Seek( STREAM_SEEK_TO_END );
-
-        pStm->Seek( nPos );
+        auto nPos = pStm->Tell();
+        auto nEnd = nPos + pStm->remainingSize();
 
         Point aWinOrg(0,0);
         boost::optional<Size>  aWinExt;
@@ -1463,7 +1460,7 @@ namespace emfio
         Point aViewportOrg(0,0);
         boost::optional<Size>  aViewportExt;
 
-        if( nEnd - nPos )
+        if (nEnd - nPos)
         {
             sal_Int16 nMapMode = MM_ANISOTROPIC;
             sal_uInt16 nFunction;
@@ -1763,12 +1760,12 @@ namespace emfio
                     break;
                 }
 
-                const sal_uInt32 nAvailableBytes = nEnd - nPos;
-                const sal_uInt32 nMaxPossibleRecordSize = nAvailableBytes/2;
+                const auto nAvailableBytes = nEnd - nPos;
+                const auto nMaxPossibleRecordSize = nAvailableBytes/2;
                 if (nRSize <= nMaxPossibleRecordSize)
                 {
                     nPos += nRSize * 2;
-                    pStm->Seek( nPos );
+                    pStm->Seek(nPos);
                 }
                 else
                 {


More information about the Libreoffice-commits mailing list