Issue 96101 - svx: ambiguous && and ||
Summary: svx: ambiguous && and ||
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.2
Assignee: ooo
QA Contact: issues@graphics
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-11 15:00 UTC by caolanm
Modified: 2010-01-23 12:50 UTC (History)
1 user (show)

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


Attachments
suspicious code (967 bytes, patch)
2008-11-11 15:01 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-11 15:00:40 UTC
X && Y || Z
binds operator precedence-wise as
(X && Y) || Z
not
X && (Y || Z)

so I am a little suspicious about...

svx/source/unodraw/UnoGraphicExporter.cxx

where we have...
if ( rSettings.mnWidth && rSettings.mnHeight && ( rSettings.mnWidth !=
aSizePixel.Width() ) || ( rSettings.mnHeight != aSizePixel.Height() ) )

i.e. 
same as 
if ( (rSettings.mnWidth && rSettings.mnHeight && ( rSettings.mnWidth !=
aSizePixel.Width() )) || ( rSettings.mnHeight != aSizePixel.Height() ) )

I suspect we mean...

if (
    rSettings.mnWidth && rSettings.mnHeight &&
    (
     (rSettings.mnWidth != aSizePixel.Width()) || 
     (rSettings.mnHeight != aSizePixel.Height())
    )
   )

if so, patch attached will make that change
Comment 1 caolanm 2008-11-11 15:01:17 UTC
Created attachment 57885 [details]
suspicious code
Comment 2 ooo 2008-11-17 10:42:57 UTC
verifying patch
Comment 3 ooo 2009-03-18 12:33:11 UTC
retargeted to 3.2
Comment 4 ooo 2009-05-15 18:21:16 UTC
fixed
Comment 5 ooo 2009-09-14 11:16:14 UTC
verified
Comment 6 caolanm 2010-01-23 12:50:06 UTC
closing