Cppcheck reports 'else if' condition matches previous condition (vcl)

julien2412 serval2412 at yahoo.fr
Sat Apr 5 16:06:24 PDT 2014


Hello,

Cppcheck reported this:
vcl/source/gdi/impimage.cxx
300	multiCondition	style	Expression is always false because 'else if'
condition matches previous condition at line 298.

Indeed we have:
    296                 else
    297                 {
    298                     if( aTmpBmpEx.IsAlpha() )
    299                         aTmpBmpEx = BitmapEx( aTmpBmp,
aTmpBmpEx.GetAlpha() );
    300                     else if( aTmpBmpEx.IsAlpha() )
    301                         aTmpBmpEx = BitmapEx( aTmpBmp,
aTmpBmpEx.GetMask() );
    302                 }
see
http://opengrok.libreoffice.org/xref/core/vcl/source/gdi/impimage.cxx#298

Should the else if be:
else if( aTmpBmpEx.IsTransparent())
?

Julien




--
View this message in context: http://nabble.documentfoundation.org/Cppcheck-reports-else-if-condition-matches-previous-condition-vcl-tp4104270.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list