Issue 96164 - 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: clippka
QA Contact: issues@graphics
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-12 16:46 UTC by caolanm
Modified: 2009-04-09 07:44 UTC (History)
1 user (show)

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


Attachments
patch to use probable intention (1.04 KB, patch)
2008-11-12 16:46 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:46:00 UTC
in sd/source/ui/app/sdmod1.cxx

we have

if( pSet &&
    SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_LANGUAGE, FALSE, &pItem ) || 
    SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pItem
) || 
    SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pItem ) )
{

by operator precedence this equates to 

if( (pSet && SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_LANGUAGE, FALSE, &pItem
)) ||
    SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pItem
) || 
    SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pItem ) )
{     

which is surely not the intent. I assume we want

if ( 
    pSet &&
    (
     SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_LANGUAGE, FALSE, &pItem ) || 
     SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE,
&pItem ) || 
     SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pItem )
    )
   )

which is what the attached patch does
Comment 1 caolanm 2008-11-12 16:46:44 UTC
Created attachment 57947 [details]
patch to use probable intention
Comment 2 wolframgarten 2008-11-13 07:43:36 UTC
Reassigned. Please handle. Thanks.
Comment 3 clippka 2009-01-12 12:09:10 UTC
thanks for the patch, applied in cws impress166 for OOo 3.1
Comment 4 sven.jacobi 2009-01-21 14:26:45 UTC
the patch has been applied properly -> verified
Comment 5 dtardon 2009-04-09 07:44:30 UTC
seen in OOO310_m9 and DEV300_m45