Issue 113314 - sw: && || ambiguity in frmpage.cxx
Summary: sw: && || ambiguity in frmpage.cxx
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: DEV300m84
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: 3.4.0
Assignee: caolanm
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2010-07-21 10:33 UTC by caolanm
Modified: 2017-05-20 10:21 UTC (History)
3 users (show)

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


Attachments
version 1, keep logic silence gcc warnings (678 bytes, patch)
2010-07-21 10:34 UTC, caolanm
no flags Details | Diff
version 2, change logic, small possibility that is what was intended (678 bytes, patch)
2010-07-21 10:34 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 2010-07-21 10:33:30 UTC
we have...

if ((bNew && !bFormat) || (bValueModified || bCheckChanged) && bLegalValue)

which by precedence becomes 

if ((bNew && !bFormat) || ((bValueModified || bCheckChanged) && bLegalValue))

which looks a little suspicious given the "bLegalValue" which is derived from
aWidthED and aHeightED and code that is being protected goes on to use
aWidthED/aHeightED, so it might have been intended as...

if (((bNew && !bFormat) || (bValueModified || bCheckChanged)) && bLegalValue)
Comment 1 caolanm 2010-07-21 10:34:00 UTC
Created attachment 70738 [details]
version 1, keep logic silence gcc warnings
Comment 2 caolanm 2010-07-21 10:34:20 UTC
Created attachment 70739 [details]
version 2, change logic, small possibility that is what was intended
Comment 3 mst.ooo 2010-07-30 14:00:41 UTC
.
Comment 4 mst.ooo 2010-07-30 14:06:39 UTC
we don't really know which of the two is right.
but i guess the bNew && !bFormat test probably means that something should be
initialized in any case.
so i've committed version 1.

fixed in cws sw34bf01
http://hg.services.openoffice.org/hg/cws/sw34bf01/rev/6796726c6e0c
Comment 5 mst.ooo 2010-10-07 11:07:39 UTC
please verify
Comment 6 caolanm 2010-10-07 11:14:28 UTC
verified