From c1e35194744b57365be0c6543774cf109b6bb8b3 Mon Sep 17 00:00:00 2001 From: "kvisco%ziplink.net" Date: Thu, 20 Apr 2000 10:11:28 +0000 Subject: [PATCH] changed a couple postfix increments to prefix, aesthetics really. git-svn-id: svn://10.0.0.236/trunk@66543 18797224-902f-48f8-a5cc-f745e15eee43 --- .../transformiix/source/xpath/StringFunctionCall.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp b/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp index fc3db4f4860..97a029de9b5 100644 --- a/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp +++ b/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp @@ -21,14 +21,14 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: StringFunctionCall.cpp,v 1.2 2000-04-07 22:58:25 Peter.VanderBeken%pandora.be Exp $ + * $Id: StringFunctionCall.cpp,v 1.3 2000-04-20 10:11:28 kvisco%ziplink.net Exp $ */ /** * StringFunctionCall * A representation of the XPath String funtions * @author Keith Visco - * @version $Revision: 1.2 $ $Date: 2000-04-07 22:58:25 $ + * @version $Revision: 1.3 $ $Date: 2000-04-20 10:11:28 $ **/ #include "FunctionLib.h" @@ -146,16 +146,17 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) { Int32 endIdx = src.length(); if ( argc == 3) { dbl += evaluateToNumber((Expr*)iter->next(),context, cs); - if (dbl == Double::POSITIVE_INFINITY) endIdx++; + if (dbl == Double::POSITIVE_INFINITY) ++endIdx; else if ( dbl == Double::NEGATIVE_INFINITY ) endIdx = 0; else endIdx = (Int32)floor(dbl); } String resultStr; //-- strings are indexed starting at 1 for XSL //-- adjust to a 0-based index - if (startIdx > 0) startIdx--; - else if (startIdx == 0 ) endIdx--; + if (startIdx > 0) --startIdx; + else if (startIdx == 0 ) --endIdx; else startIdx=0; + src.subString(startIdx,endIdx,resultStr); result = new StringResult(resultStr); }