Added fix from Marc Schefer regarding OR expressions
git-svn-id: svn://10.0.0.236/trunk@183420 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a6252ccf9c
commit
3a7bc775da
@ -3,25 +3,30 @@
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT processor.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is The MITRE Corporation.
|
||||
* Portions created by MITRE are Copyright (C) 1999 The MITRE Corporation.
|
||||
*
|
||||
* Portions created by Keith Visco as a Non MITRE employee,
|
||||
* (C) 1999 Keith Visco. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Contributor(s):
|
||||
* Keith Visco, kvisco@ziplink.net
|
||||
* -- original author.
|
||||
*
|
||||
* $Id: txBooleanExpr.cpp,v 1.1 2005-11-02 07:33:46 kvisco%ziplink.net Exp $
|
||||
*
|
||||
* Marc Schefer, schefer@xo3.com
|
||||
* -- fixed a bug regarding Or expressions
|
||||
* - If the left hand was false, the right hand expression
|
||||
* was not getting checked.
|
||||
*
|
||||
* $Id: txBooleanExpr.cpp,v 1.2 2005-11-02 07:33:47 kvisco%ziplink.net Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +34,7 @@
|
||||
* Represents a BooleanExpr, a binary expression that
|
||||
* performs a boolean operation between it's lvalue and rvalue:<BR/>
|
||||
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
|
||||
* @version $Revision: 1.1 $ $Date: 2005-11-02 07:33:46 $
|
||||
* @version $Revision: 1.2 $ $Date: 2005-11-02 07:33:47 $
|
||||
**/
|
||||
|
||||
#include "Expr.h"
|
||||
@ -92,8 +97,7 @@ ExprResult* BooleanExpr::evaluate(Node* context, ContextState* cs) {
|
||||
|
||||
//-- check left expression for early decision
|
||||
if (( op == OR ) && (lval)) return new BooleanResult(MB_TRUE);
|
||||
else if (!lval) return new BooleanResult(MB_FALSE);
|
||||
|
||||
else if ((op == AND) && (!lval)) return new BooleanResult(MB_FALSE);
|
||||
|
||||
MBool rval = MB_FALSE;
|
||||
if ( rightExpr ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user