diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-22 10:02:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-22 13:33:46 +0100 |
commit | df2e78f1a8a1dc628eb26c8173ba1f6bae0ca6f4 (patch) | |
tree | 6aaf6d2f2613c3de773e3d3134b0d1354e0d0b12 /vcl/source | |
parent | 2161d04688be77112c281a1ada5263b963677c43 (diff) |
replace check of eof and GetError with good
Change-Id: I7d9f04262ab5420e9a14813fa1274bb9d01e3291
Reviewed-on: https://gerrit.libreoffice.org/45076
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/graphicfilter2.cxx | 13 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pngread.cxx | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index 2f846029bb9b..ae181f4269b6 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -221,14 +221,14 @@ sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) do { rStm.ReadUChar( nByte ); - if ( rStm.eof() || rStm.GetError() ) // as 0 is not allowed as marker, - return 0; // we can use it as errorcode + if (!rStm.good()) // as 0 is not allowed as marker, + return 0; // we can use it as errorcode } while ( nByte != 0xff ); do { rStm.ReadUChar( nByte ); - if ( rStm.eof() || rStm.GetError() ) + if (!rStm.good()) return 0; } while( nByte == 0xff ); @@ -263,7 +263,7 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) bool bScanFailure = false; bool bScanFinished = false; - while( !bScanFailure && !bScanFinished && !rStm.eof() && !rStm.GetError() ) + while (!bScanFailure && !bScanFinished && rStm.good()) { sal_uInt8 nMarker = ImpDetectJPG_GetNextMarker( rStm ); switch( nMarker ) @@ -555,15 +555,14 @@ bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, bool bExtendedInfo ) rStm.ReadUInt32( nLen32 ); rStm.ReadUInt32( nTemp32 ); while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) - && !rStm.eof() && !rStm.GetError() ) + && rStm.good() ) { rStm.SeekRel( 4 + nLen32 ); rStm.ReadUInt32( nLen32 ); rStm.ReadUInt32( nTemp32 ); } - if ( nTemp32 == 0x70485973 - && !rStm.eof() && !rStm.GetError() ) + if (nTemp32 == 0x70485973 && rStm.good()) { sal_uLong nXRes; sal_uLong nYRes; diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 5ee08a2f21c7..a9772a2fd379 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1444,7 +1444,7 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic ) // reading which will create VDevs and other stuff, just to // read nothing. CAUTION: Eof is only true AFTER reading another // byte, a speciality of SvMemoryStream (!) - if (rIStm.GetError() || rIStm.eof()) + if (!rIStm.good()) return; if (NATIVE_FORMAT_50 == nTmp) diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index ff34bd129eb6..2458d0269e76 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -263,7 +263,7 @@ bool PNGReaderImpl::ReadNextChunk() // get the next chunk from the stream // unless we are at the end of the PNG stream - if( mrPNGStream.eof() || (mrPNGStream.GetError() != ERRCODE_NONE) ) + if (!mrPNGStream.good()) return false; if( !maChunkSeq.empty() && (maChunkSeq.back().nType == PNGCHUNK_IEND) ) return false; |