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

Caolán McNamara caolanm at redhat.com
Wed Nov 22 14:56:25 UTC 2017


 filter/source/graphicfilter/itiff/ccidecom.cxx |    2 +-
 filter/source/graphicfilter/itiff/itiff.cxx    |    4 ++--
 filter/source/msfilter/msdffimp.cxx            |    4 ++--
 sc/source/filter/lotus/lotread.cxx             |    4 ++--
 sc/source/filter/qpro/qpro.cxx                 |    2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 129852d379fa03c36886b5f48d6a10e530a9c3de
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 22 10:27:36 2017 +0000

    turn some eof checks to eof or error
    
    Change-Id: I4592d7aa86c2cc2f420bccc622ffb95aa5cefa17
    Reviewed-on: https://gerrit.libreoffice.org/45077
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 815a75e5deba..9d638c0260c3 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -769,7 +769,7 @@ bool CCIDecompressor::ReadEOL()
         while ( nInputBitsBufSize < 12 )
         {
             pIStream->ReadUChar( nByte );
-            if ( pIStream->eof() )
+            if (!pIStream->good())
                 return false;
             if ( pIStream->Tell() > nMaxPos )
                 return false;
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 988e791a6431..12e53b314478 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -1234,7 +1234,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
                     nMaxPos = std::max(nOrigPos + nOffset + DataTypeSize() * nDataLen, nMaxPos);
             }
             pTIFF->ReadUInt32( nOffset );
-            if ( pTIFF->eof() )
+            if (!pTIFF->good())
                 nOffset = 0;
 
             nMaxPos = std::max( pTIFF->Tell(), nMaxPos );
@@ -1325,7 +1325,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
                         break;
                 }
                 pTIFF->ReadUInt32( nNextIfd );
-                if ( pTIFF->eof() )
+                if (!pTIFF->good())
                     nNextIfd = 0;
             }
             if ( !nBitsPerSample || ( nBitsPerSample > 32 ) )
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index ebc214ef36fb..eac8803da7f4 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6774,7 +6774,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen,
 
         nBytesRead += 6 * sizeof( sal_uInt32 ) + nStrLen + nDataLen;
 
-        if( !rStm.eof() && nReadLen > nBytesRead && nDataLen )
+        if (rStm.good() && nReadLen > nBytesRead && nDataLen)
         {
             if( xOle10Stm.is() )
             {
@@ -6828,7 +6828,7 @@ bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen,
             else
                 rStm.SeekRel( nDataLen );
         }
-    } while( !rStm.eof() && nReadLen >= nBytesRead );
+    } while (rStm.good() && nReadLen >= nBytesRead);
 
     if( !bMtfRead && pMtf )
     {
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index afb176ec7f19..7878c97288c0 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -61,7 +61,7 @@ ErrCode ImportLotus::Read()
     {
         pIn->ReadUInt16( nOp ).ReadUInt16( nRecLen );
 
-        if( pIn->eof() || nNextRec > SAL_MAX_UINT32 - nRecLen - 4 )
+        if (!pIn->good() || nNextRec > SAL_MAX_UINT32 - nRecLen - 4)
             eAkt = S_END;
 
         nNextRec += nRecLen + 4;
@@ -245,7 +245,7 @@ ErrCode ImportLotus::Read(SvStream& rIn)
     {
         pIn->ReadUInt16( nOp ).ReadUInt16( nRecLen );
 
-        if( pIn->eof() || nNextRec > SAL_MAX_UINT32 - nRecLen - 4 )
+        if (!pIn->good() || nNextRec > SAL_MAX_UINT32 - nRecLen - 4)
             bRead = false;
         else
         {
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 6326aae08cf6..0c1d18d59ffd 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -225,7 +225,7 @@ ErrCode ScQProReader::import( ScDocument *pDoc )
 
 bool ScQProReader::recordsLeft()
 {
-    return mpStream && !mpStream->eof();
+    return mpStream && mpStream->good();
 }
 
 bool ScQProReader::nextRecord()


More information about the Libreoffice-commits mailing list