summaryrefslogtreecommitdiff
path: root/vcl/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-22 10:02:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-22 13:33:46 +0100
commitdf2e78f1a8a1dc628eb26c8173ba1f6bae0ca6f4 (patch)
tree6aaf6d2f2613c3de773e3d3134b0d1354e0d0b12 /vcl/source/filter
parent2161d04688be77112c281a1ada5263b963677c43 (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/filter')
-rw-r--r--vcl/source/filter/graphicfilter2.cxx13
1 files changed, 6 insertions, 7 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;