Issue 96636 - dbaccess: ambiguous && ||
Summary: dbaccess: ambiguous && ||
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: DEV300m36
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: ocke.janssen
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-26 23:19 UTC by caolanm
Modified: 2009-02-26 13:34 UTC (History)
1 user (show)

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


Attachments
patch to use probable intention (681 bytes, patch)
2008-11-26 23:20 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-26 23:19:44 UTC
in dbaccess/source/ui/control/FieldDescControl.cxx we have...

if ( pFieldType.get() && !pFieldType->bNullable || !pFieldDescr->IsNullable() )

which by operator precedence is equal to

if ( (pFieldType.get() && !pFieldType->bNullable) || !pFieldDescr->IsNullable() )

It seems likely we really mean...

if ( pFieldType.get() && (!pFieldType->bNullable || !pFieldDescr->IsNullable()) )

if so then the attached patch does that
Comment 1 caolanm 2008-11-26 23:20:31 UTC
Created attachment 58336 [details]
patch to use probable intention
Comment 2 Frank Schönheit 2008-11-27 09:55:47 UTC
will integrate into next possible CWS, thanks.
Comment 3 Frank Schönheit 2008-12-09 16:30:51 UTC
Looking at it again ...

if ( pFieldType.get() && !pFieldType->bNullable || !pFieldDescr->IsNullable() )

Note that there are a pFieldType and a pFieldDescr, so in fact the proper patch
is replacing this with something like

if ( ( pFieldType.get() && !pFieldType->bNullable ) ||
     !pFieldDescr->IsNullable() )

Committed to CWS dba31g, as revision 265120.
Comment 4 caolanm 2008-12-09 16:35:45 UTC
Oops, sorry, mis-read it to be the same variable in each term
Comment 5 Frank Schönheit 2009-01-07 08:12:21 UTC
fs->oj: please verify in CWS dba31g
Comment 6 ocke.janssen 2009-01-07 08:55:19 UTC
Verified.
Comment 7 ocke.janssen 2009-02-26 13:34:55 UTC
find more information about this CWS, like when it is available in the master
builds, in EIS, the Environment Information System:
http://eis.services.openoffice.org/

this is fixed in the current master. The current master is available at
http://download.openoffice.org/680/index.html

I close this issue now.