Issue 96111 - sw: ambiguous && ||
Summary: sw: ambiguous && ||
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: andreas.martens
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-11 16:07 UTC by caolanm
Modified: 2013-08-07 14:43 UTC (History)
1 user (show)

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


Attachments
suspicious code (1.04 KB, patch)
2008-11-11 16: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 16:07:38 UTC
This one looks definitely wrong.

in sw/source/ui/docvw/edtwin.cxx we have

if(pACorr &&
    ( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
    ( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh)))

which means

if( (pACorr &&
    ( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))) ||
    ( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh)))

i.e. if pACorr is null we will try and execute pACorr->IsAutoCorrFlag(
ChgSglQuotes )

I suspect we mean

if (
    pACorr &&
    (
     (pACorr->IsAutoCorrFlag(ChgQuotes) && ('\"' == aCh)) ||
     (pACorr->IsAutoCorrFlag(ChgSglQuotes) && ('\'' == aCh))
    )
   )

patch attached to do that
Comment 1 caolanm 2008-11-11 16:08:13 UTC
Created attachment 57896 [details]
suspicious code
Comment 2 andreas.martens 2009-01-16 08:09:48 UTC
Ok, ok, you're right.

Fixed in sw31bf02.
Comment 3 andreas.martens 2009-01-23 13:30:22 UTC
Verified in CWS sw31bf02.
Comment 4 caolanm 2009-03-23 16:20:46 UTC
closed, seen in m44