From 3a7bc775dafdbb44a19186ea4db274ea7036d082 Mon Sep 17 00:00:00 2001 From: "kvisco%ziplink.net" Date: Wed, 2 Nov 2005 07:34:18 +0000 Subject: [PATCH] Added fix from Marc Schefer regarding OR expressions git-svn-id: svn://10.0.0.236/trunk@183420 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/xslt/src/xpath/txBooleanExpr.cpp | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp b/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp index b9305d17b6a..928f38ca778 100644 --- a/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp +++ b/mozilla/content/xslt/src/xpath/txBooleanExpr.cpp @@ -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:
* @author Keith Visco - * @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 ) {