Cppcheck:"Logical disjunction always evaluates to true" in svdotextdecomposition.cxx (svx module)

julien2412 serval2412 at yahoo.fr
Sat Sep 6 04:16:43 PDT 2014


Hello,

Cppcheck reported this:
1237	incorrectLogicOperator	style	Logical disjunction always evaluates to
true: nRepeat||!nRepeat.
in svx/source/svdraw/svdotextdecomposition.cxx
Indeed, we've got this:
   1236     // loop. In loop, move through
   1237     if(nRepeat || 0L == nRepeat)
   1238     {
   1239         drawinglayer::animation::AnimationEntryLoop aLoop(nRepeat ?
nRepeat : ENDLESS_LOOP);
   1240         drawinglayer::animation::AnimationEntryLinear
aThrough(fTimeFullPath, fFrequency, bForward ? 0.0 : 1.0, bForward ? 1.0 :
0.0);
   1241         aLoop.append(aThrough);
   1242         rAnimList.append(aLoop);
   1243     }
See
http://opengrok.libreoffice.org/xref/core/svx/source/svdraw/svdotextdecomposition.cxx#1237

First I thought about removing the test about nRepeat == 0L but line 1239
expects to have nRepeat different or equal to 0.

Any idea?

Julien



--
View this message in context: http://nabble.documentfoundation.org/Cppcheck-Logical-disjunction-always-evaluates-to-true-in-svdotextdecomposition-cxx-svx-module-tp4121365.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list