Issue 96109 - sw: dubious code
Summary: sw: dubious code
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: Oliver Specht
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-11 15:48 UTC by caolanm
Modified: 2013-08-07 14:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-11-11 15:48:44 UTC
in sw/source/ui/uiview/viewport.cxx

we have...
if ( bRepeat && nCnt > 10 || (nCnt > 3 && bHAuto && bAuto &&
 bAuto  && bHAuto) )

i.e. (bHAuto && bAuto && bAuto && bHAuto) which doesn't make a lot of sense,
perhaps there was intended to be a use of bVAuto in there, or maybe it just got
duplicated accidentally and should simply be...

if ( bRepeat && nCnt > 10 || (nCnt > 3 && bHAuto && bAuto) )

the second thing is that it's a little ambiguous if the operator precedence that
will be used is truly intentional, i.e. that becomes...

if ( (bRepeat && nCnt > 10) || (nCnt > 3 && bHAuto && bAuto) )

but there's a chance that the meaning might be

if ( bRepeat && (nCnt > 10 || (nCnt > 3 && bHAuto && bAuto)) )

sticking some brackets around it to explicitly state the intent would be great
Comment 1 andreas.martens 2009-01-19 08:28:32 UTC
Fixed in CWS sw31bf02
Comment 2 andreas.martens 2009-01-23 13:31:54 UTC
Ready for QA ;-)
Comment 3 Oliver Specht 2009-01-26 09:02:59 UTC
verified in cws sw31bf02
Comment 4 caolanm 2009-03-23 16:21:05 UTC
closed, integrated