[PUSHED-3-5] Re: [REVIEW:3-5] "Redundant assignment" in oox

Lubos Lunak l.lunak at suse.cz
Sun Apr 8 10:38:14 PDT 2012


On Saturday 07 of April 2012, julien2412 wrote:
> Hello,
>
> Cppcheck reported this :
> [oox/source/vml/vmlformatting.cxx:251]: (warning) Redundant assignment of
> "nModToken" in switch
> Here are the lines :
>     249             switch( AttributeConversion::decodeToken(
> aColorIndex.copy( 0, nOpenParen ) ) )
>     250             {
>     251                 case XML_darken:    nModToken = XML_shade;
>     252                 case XML_lighten:   nModToken = XML_tint;
>     253             }
>
>
> I pushed a fix on master c893a820c447c9014d35597a37c3220c261e35ae to just
> add a break at the end of line 251.
>
> could it be useful to push this on 3.5 branch this trivial fix ?

 Pushed.

 Note that it is a good practice to always end each 'case' with break (or 
add /*fallthrough intended*/ ) so that the problem does not come up again 
when more cases are added.

-- 
 Lubos Lunak
 l.lunak at suse.cz


More information about the LibreOffice mailing list