Issue 96103 - svx: dodgy code in svx
Summary: svx: dodgy code in svx
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:07 UTC by caolanm
Modified: 2010-01-23 12:49 UTC (History)
1 user (show)

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


Attachments
suspicious code (684 bytes, patch)
2008-11-11 15:08 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:07:32 UTC
in 
svx/source/dialog/svxruler.cxx

we have...

if(RULER_TYPE_BORDER == eType || RULER_TYPE_TAB == eType ||
 RULER_TYPE_MARGIN1 && pColumnItem)

which is odd, I suspect that we might want RULER_TYPE_MARGIN1 == eType at the
least. After that its not totally clear if we mean

if( RULER_TYPE_BORDER == eType || RULER_TYPE_TAB == eType ||
 (RULER_TYPE_MARGIN1 == eType && pColumnItem) )

or

if( (RULER_TYPE_BORDER == eType || RULER_TYPE_TAB == eType ||
 RULER_TYPE_MARGIN1) && pColumnItem)

Assuming the first one, then the patch attached would do that, but it would
depend on the original intent of the code which I can't guess
Comment 1 caolanm 2008-11-11 15:08:03 UTC
Created attachment 57891 [details]
suspicious code
Comment 2 ooo 2008-11-17 10:45:38 UTC
verifying patch
Comment 3 ooo 2009-03-18 12:33:54 UTC
retargeted to 3.2
Comment 4 ooo 2009-05-15 18:09:44 UTC
I adjusted your patch a little bit to also take care of RULER_TYPE_BORDER and
pColumnItem set, as is needed in the called method for both types:

if( RULER_TYPE_TAB == eType ||
    ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType ) &&
      pColumnItem ) )  
Comment 5 ooo 2009-09-14 11:16:55 UTC
verified
Comment 6 caolanm 2010-01-23 12:49:44 UTC
closing