[SOLVED] Re: Cppcheck reports 'else if' condition matches previous condition (vcl)

Julien Nabet serval2412 at yahoo.fr
Sat Apr 12 08:49:36 PDT 2014


On 11/04/2014 16:13, Caolán McNamara wrote:
> On Sat, 2014-04-05 at 16:06 -0700, julien2412 wrote:
>> 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())
> "grep -r IsAlpha -C 5 vcl|grep else" definitely strongly suggests that
> was the intent. I reckon its worth making that change and see if
> anything falls over. Not the kind of thing I'd backport to 4-2 unless we
> get compelling evidence to do that.
Thank you Caolán, I pushed the change in master, see 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=6c6f78c6567db73aa85de4beb461db2cddac7b2a

Julien



More information about the LibreOffice mailing list