Issue 96165 - sd: ambiguous && ||
Summary: sd: 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 16:52 UTC by caolanm
Modified: 2009-05-29 10:35 UTC (History)
2 users (show)

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


Attachments
makes current logic explicit (684 bytes, patch)
2008-11-12 16:52 UTC, caolanm
no flags Details | Diff
changes current behaviour, but might be what was intended (716 bytes, patch)
2008-11-12 16:53 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 16:52:05 UTC
in source/filter/eppt/pptexanimations.cxx we have

if ( ( nPresetClass == (sal_uInt32)EffectPresetClass::ENTRANCE ) || (
nPresetClass == (sal_uInt32)EffectPresetClass::EXIT ) && ( nPresetId != 21 ) )

by operator precedence this expands to.

if (
    (nPresetClass == (sal_uInt32)EffectPresetClass::ENTRANCE) ||
    ((nPresetClass == (sal_uInt32)EffectPresetClass::EXIT) && (nPresetId != 21))
   )   

is that really what we meant, if so then attachment 1 [details] makes this explicit.

or did we actually mean

if (
    (   
     (nPresetClass == (sal_uInt32)EffectPresetClass::ENTRANCE) ||
     (nPresetClass == (sal_uInt32)EffectPresetClass::EXIT)
    ) &&  
    (nPresetId != 21) 
   )   

which is what patch 2 would do
Comment 1 caolanm 2008-11-12 16:52:31 UTC
Created attachment 57948 [details]
makes current logic explicit
Comment 2 caolanm 2008-11-12 16:53:26 UTC
Created attachment 57949 [details]
changes current behaviour, but might be what was intended
Comment 3 ooo 2008-11-17 10:39:40 UTC
KA=>SJ: could you verify this patch, please?
Comment 4 sven.jacobi 2008-11-20 17:45:23 UTC
the second patch was meant if I am taking the opposite from the import code. I
have applied the patch to cws[sjfixes10].
Comment 5 caolanm 2009-05-29 10:35:39 UTC
closing