Issue 96114 - rtf: suspicious ambiguous && ||
Summary: rtf: suspicious ambiguous && ||
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: save-export (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: openoffice
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-11 17:03 UTC by caolanm
Modified: 2013-08-07 14:43 UTC (History)
2 users (show)

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


Attachments
suspicious code (688 bytes, patch)
2008-11-11 17:03 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 17:03:20 UTC
in sw/source/filter/rtf/wrtrtf.cxx

we have
if( nsUseOnPage::PD_MIRROR & pAktPageDesc->GetUseOn() &&
  !pAktPageDesc->IsFooterShared() || !pAktPageDesc->IsHeaderShared() )

which expanded by operator precedence is
if( (nsUseOnPage::PD_MIRROR & pAktPageDesc->GetUseOn() &&
  !pAktPageDesc->IsFooterShared()) || !pAktPageDesc->IsHeaderShared() )

which looks real suspicious, it might have been intended to be

if (
    (nsUseOnPage::PD_MIRROR & pAktPageDesc->GetUseOn()) &&
    (!pAktPageDesc->IsFooterShared() || !pAktPageDesc->IsHeaderShared())
   )

If the second was intended, then the attached patch changes it to that.
Comment 1 caolanm 2008-11-11 17:03:55 UTC
Created attachment 57901 [details]
suspicious code
Comment 2 openoffice 2008-11-12 10:12:45 UTC
set target
Comment 3 openoffice 2008-11-17 12:48:04 UTC
applied patch
Comment 4 openoffice 2008-11-17 12:49:36 UTC
Sending        source/filter/rtf/wrtrtf.cxx
Transmitting file data .
Committed revision 263721.
Comment 5 openoffice 2008-12-01 14:21:21 UTC
reassigned
Comment 6 openoffice 2008-12-01 14:22:07 UTC
verified
Comment 7 openoffice 2009-02-16 12:20:49 UTC
closed