Landing TX_BRIDGE_1_1_BRANCH.
Rewrite pretty much all variable and parameter handling. Makes global and local variables be handled differently. Global variables are no longer part of the variables stack, and are lazily evaluated. Fixes bugs 117658, 92929 and some unfiled bugs and fixes remaining parts of bugs 83651 and 96802. Patch by sicking, r=Pike sr=bz. Fix for bug 156464: fix rounding problems in module, allow patterns without any '0's in the integer part and fix problems with grouping for standalone. Patch by sicking, r=Pike sr=bz. Fix for bug 157340 (Probable bugs in extensions/transformiix/source/base/txMozillaString.h). Patch by peterv, r=Pike, sr=bz. Fix for bug 146967 (Clean up Transformiix strings). Patch by peterv, r=sicking, sr=jst. Fix for bug 156464 (Remove static strings from Transformiix). Patch by peterv, r=Pike, sr=jst. git-svn-id: svn://10.0.0.236/trunk@126495 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -34,32 +34,17 @@
|
||||
*/
|
||||
|
||||
#include "FunctionLib.h"
|
||||
#include "XMLDOMUtils.h"
|
||||
#include <math.h>
|
||||
#include "txAtoms.h"
|
||||
#include "txIXPathContext.h"
|
||||
#include "XMLDOMUtils.h"
|
||||
|
||||
/*
|
||||
* Creates a NumberFunctionCall of the given type
|
||||
*/
|
||||
NumberFunctionCall::NumberFunctionCall(NumberFunctions aType) {
|
||||
mType = aType;
|
||||
switch (mType) {
|
||||
case ROUND:
|
||||
name = XPathNames::ROUND_FN;
|
||||
break;
|
||||
case CEILING:
|
||||
name = XPathNames::CEILING_FN;
|
||||
break;
|
||||
case FLOOR:
|
||||
name = XPathNames::FLOOR_FN;
|
||||
break;
|
||||
case SUM:
|
||||
name = XPathNames::SUM_FN;
|
||||
break;
|
||||
case NUMBER:
|
||||
name = XPathNames::NUMBER_FN;
|
||||
break;
|
||||
}
|
||||
NumberFunctionCall::NumberFunctionCall(NumberFunctions aType)
|
||||
: mType(aType)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -151,3 +136,41 @@ ExprResult* NumberFunctionCall::evaluate(txIEvalContext* aContext)
|
||||
aContext->receiveError(err, NS_ERROR_UNEXPECTED);
|
||||
return new StringResult("error");
|
||||
}
|
||||
|
||||
nsresult NumberFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
{
|
||||
switch (mType) {
|
||||
case NUMBER:
|
||||
{
|
||||
*aAtom = txXPathAtoms::number;
|
||||
break;
|
||||
}
|
||||
case ROUND:
|
||||
{
|
||||
*aAtom = txXPathAtoms::round;
|
||||
break;
|
||||
}
|
||||
case FLOOR:
|
||||
{
|
||||
*aAtom = txXPathAtoms::floor;
|
||||
break;
|
||||
}
|
||||
case CEILING:
|
||||
{
|
||||
*aAtom = txXPathAtoms::ceiling;
|
||||
break;
|
||||
}
|
||||
case SUM:
|
||||
{
|
||||
*aAtom = txXPathAtoms::sum;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
*aAtom = 0;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user