summaryrefslogtreecommitdiff
path: root/vcl/source/filter/ixpm
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-25 11:24:36 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-25 12:45:22 +0000
commit39ced315aa6c49ea233e774a6a834df4823a1ed9 (patch)
tree32fce11e305273f8f98bfc7ede605c66412fc303 /vcl/source/filter/ixpm
parent13a9b2045727597c1ab6fa1dc01393b1a73ef280 (diff)
return early
Change-Id: Ia8504fdbc952b1e116bdca135a063d4d98be92be Reviewed-on: https://gerrit.libreoffice.org/33531 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/filter/ixpm')
-rw-r--r--vcl/source/filter/ixpm/xpmread.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx
index 6dc924f43924..dd31d971f21a 100644
--- a/vcl/source/filter/ixpm/xpmread.cxx
+++ b/vcl/source/filter/ixpm/xpmread.cxx
@@ -280,25 +280,21 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
// ImplGetColor returns various colour values,
// returns TRUE if various colours could be assigned
-
bool XPMReader::ImplGetColor( sal_uLong nNumb )
{
sal_uInt8* pString = mpStringBuf;
- sal_uInt8* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) );
- bool bStatus = ImplGetString();
+ if (!ImplGetString())
+ return false;
- if ( bStatus )
- {
- for ( sal_uLong i = 0; i < mnCpp; i++ )
- *pPtr++ = *pString++;
- bStatus = ImplGetColSub ( pPtr );
- }
+ sal_uInt8* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) );
+ for (sal_uLong i = 0; i < mnCpp; ++i)
+ *pPtr++ = *pString++;
+ bool bStatus = ImplGetColSub(pPtr);
return bStatus;
}
// ImpGetScanLine reads the string mpBufSize and writes the pixel in the
// Bitmap. Parameter nY is the horizontal position.
-
bool XPMReader::ImplGetScanLine( sal_uLong nY )
{
bool bStatus = ImplGetString();