[RESOLVED] cppcheck: Same expression in edtwin.cxx (sw module)

Caolán McNamara caolanm at redhat.com
Wed Dec 18 02:31:16 PST 2013


On Fri, 2013-12-13 at 15:26 -0800, julien2412 wrote:
> Hello,
> 
> Cppcheck reported this:
> [sw/source/ui/docvw/edtwin.cxx:3322] ->
> [sw/source/ui/docvw/edtwin.cxx:3322]: (style) Same expression on both sides
> of '&&'
> 
> Indeed we have:
>    3319                         // if the cursor position was corrected or
> if a Fly
>    3320                         // was selected in ReadOnlyMode, no word
> selection.
>    3321                         if ( !bValidCrsrPos ||
>    3322                             (rSh.IsFrmSelected() &&
> rSh.IsFrmSelected() ))
>    3323                             return;
> 
> git history indicates it's like this since initial import in (2000-03-18)
> Of course I could remove one rSh.IsFrmSelected() but not sure at all when
> reading comment above.

On line 3388 we have the exact same comment and same condition, except
this time its not duplicating the IsFrmSelected test which swung the
vote for me. So I removed the redundant check on this 3321 line to match
it.

C.



More information about the LibreOffice mailing list