Issue 96146 - sdext: dodgy ambiguous && ||
Summary: sdext: dodgy ambiguous && ||
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: code (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: sven.jacobi
QA Contact: issues@graphics
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-12 11:24 UTC by caolanm
Modified: 2017-05-20 10:27 UTC (History)
2 users (show)

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


Attachments
make current logic explicit (553 bytes, patch)
2008-11-12 11:24 UTC, caolanm
no flags Details | Diff
but perhaps this was what was intended (553 bytes, patch)
2008-11-12 11:25 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-11-12 11:24:10 UTC
in sdext/source/minimizer/optimizerdialog.cxx 
we have
if ( ( nNewStep != mnCurrentStep ) && ( nNewStep <= MAX_STEP ) || ( nNewStep >=
0 ) )

which by operator precedence means

if ( (( nNewStep != mnCurrentStep ) && ( nNewStep <= MAX_STEP )) || ( nNewStep
>= 0 ) 

(patch 1 makes this explicit)

but is that really what we want, looks suspicious, perhaps we want

if ( ( nNewStep != mnCurrentStep ) && (( nNewStep <= MAX_STEP ) || ( nNewStep >=
0 )) )

like patch 2 does ?
Comment 1 caolanm 2008-11-12 11:24:39 UTC
Created attachment 57931 [details]
make current logic explicit
Comment 2 caolanm 2008-11-12 11:25:15 UTC
Created attachment 57932 [details]
but perhaps this was what was intended
Comment 3 wolframgarten 2008-11-12 11:33:15 UTC
Reassigned. Please handle.
Comment 4 sven.jacobi 2008-11-21 09:17:32 UTC
changed owner
Comment 5 sven.jacobi 2008-11-21 09:25:51 UTC
the patch has been applied in cws[sjfixes10]