Kaydet (Commit) 129852d3 authored tarafından Caolán McNamara's avatar Caolán McNamara

turn some eof checks to eof or error

Change-Id: I4592d7aa86c2cc2f420bccc622ffb95aa5cefa17
Reviewed-on: https://gerrit.libreoffice.org/45077Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 97f087f4
......@@ -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;
......
......@@ -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 ) )
......
......@@ -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 )
{
......
......@@ -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
{
......
......@@ -225,7 +225,7 @@ ErrCode ScQProReader::import( ScDocument *pDoc )
bool ScQProReader::recordsLeft()
{
return mpStream && !mpStream->eof();
return mpStream && mpStream->good();
}
bool ScQProReader::nextRecord()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment