xslt doesn't build on Windows Mobile. r=jonas, a=beltzner

This commit is contained in:
dougt%meer.net 2008-02-20 22:44:23 +00:00
Родитель 3d13578e22
Коммит 20cb0cd1af
2 изменённых файлов: 28 добавлений и 24 удалений

Просмотреть файл

@ -114,12 +114,12 @@ txFunctionEvaluationContext::GetState(nsISupports **aState)
} }
enum txArgumentType { enum txArgumentType {
BOOLEAN = nsXPTType::T_BOOL, eBOOLEAN = nsXPTType::T_BOOL,
NUMBER = nsXPTType::T_DOUBLE, eNUMBER = nsXPTType::T_DOUBLE,
STRING = nsXPTType::T_DOMSTRING, eSTRING = nsXPTType::T_DOMSTRING,
NODESET, eNODESET,
CONTEXT, eCONTEXT,
UNKNOWN eUNKNOWN
}; };
class txXPCOMExtensionFunctionCall : public FunctionCall class txXPCOMExtensionFunctionCall : public FunctionCall
@ -302,16 +302,16 @@ txXPCOMExtensionFunctionCall::GetParamType(const nsXPTParamInfo &aParam,
nsIID iid; nsIID iid;
aInfo->GetIIDForParamNoAlloc(mMethodIndex, &aParam, &iid); aInfo->GetIIDForParamNoAlloc(mMethodIndex, &aParam, &iid);
if (iid.Equals(NS_GET_IID(txINodeSet))) { if (iid.Equals(NS_GET_IID(txINodeSet))) {
return NODESET; return eNODESET;
} }
if (iid.Equals(NS_GET_IID(txIFunctionEvaluationContext))) { if (iid.Equals(NS_GET_IID(txIFunctionEvaluationContext))) {
return CONTEXT; return eCONTEXT;
} }
} }
default: default:
{ {
// XXX Error! // XXX Error!
return UNKNOWN; return eUNKNOWN;
} }
} }
} }
@ -390,13 +390,13 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
const nsXPTParamInfo &paramInfo = methodInfo->GetParam(0); const nsXPTParamInfo &paramInfo = methodInfo->GetParam(0);
txArgumentType type = GetParamType(paramInfo, info); txArgumentType type = GetParamType(paramInfo, info);
if (type == UNKNOWN) { if (type == eUNKNOWN) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
txFunctionEvaluationContext *context; txFunctionEvaluationContext *context;
PRUint32 paramStart = 0; PRUint32 paramStart = 0;
if (type == CONTEXT) { if (type == eCONTEXT) {
if (paramInfo.IsOut()) { if (paramInfo.IsOut()) {
// We don't support out values. // We don't support out values.
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -431,7 +431,7 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
const nsXPTParamInfo &paramInfo = methodInfo->GetParam(i); const nsXPTParamInfo &paramInfo = methodInfo->GetParam(i);
txArgumentType type = GetParamType(paramInfo, info); txArgumentType type = GetParamType(paramInfo, info);
if (type == UNKNOWN) { if (type == eUNKNOWN) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -443,7 +443,7 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
invokeParam.type = paramInfo.GetType(); invokeParam.type = paramInfo.GetType();
switch (type) { switch (type) {
case NODESET: case eNODESET:
{ {
nsRefPtr<txNodeSet> nodes; nsRefPtr<txNodeSet> nodes;
rv = evaluateToNodeSet(expr, aContext, getter_AddRefs(nodes)); rv = evaluateToNodeSet(expr, aContext, getter_AddRefs(nodes));
@ -462,19 +462,19 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
nodeSet.swap((txINodeSet*&)invokeParam.val.p); nodeSet.swap((txINodeSet*&)invokeParam.val.p);
break; break;
} }
case BOOLEAN: case eBOOLEAN:
{ {
rv = expr->evaluateToBool(aContext, invokeParam.val.b); rv = expr->evaluateToBool(aContext, invokeParam.val.b);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
break; break;
} }
case NUMBER: case eNUMBER:
{ {
invokeParam.val.d = evaluateToNumber(expr, aContext); invokeParam.val.d = evaluateToNumber(expr, aContext);
break; break;
} }
case STRING: case eSTRING:
{ {
nsString *value = new nsString(); nsString *value = new nsString();
if (!value) { if (!value) {
@ -488,8 +488,8 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
invokeParam.val.p = value; invokeParam.val.p = value;
break; break;
} }
case CONTEXT: case eCONTEXT:
case UNKNOWN: case eUNKNOWN:
{ {
// We only support passing the context as the *first* argument. // We only support passing the context as the *first* argument.
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -499,13 +499,13 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
const nsXPTParamInfo &returnInfo = methodInfo->GetParam(inArgs); const nsXPTParamInfo &returnInfo = methodInfo->GetParam(inArgs);
txArgumentType returnType = GetParamType(returnInfo, info); txArgumentType returnType = GetParamType(returnInfo, info);
if (returnType == UNKNOWN) { if (returnType == eUNKNOWN) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
nsXPTCVariant &returnParam = invokeParams[inArgs]; nsXPTCVariant &returnParam = invokeParams[inArgs];
returnParam.type = returnInfo.GetType(); returnParam.type = returnInfo.GetType();
if (returnType == STRING) { if (returnType == eSTRING) {
nsString *value = new nsString(); nsString *value = new nsString();
if (!value) { if (!value) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -530,7 +530,7 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
switch (returnType) { switch (returnType) {
case NODESET: case eNODESET:
{ {
txINodeSet *nodeSet = static_cast<txINodeSet*> txINodeSet *nodeSet = static_cast<txINodeSet*>
(returnParam.val.p); (returnParam.val.p);
@ -539,18 +539,18 @@ txXPCOMExtensionFunctionCall::evaluate(txIEvalContext* aContext,
return NS_OK; return NS_OK;
} }
case BOOLEAN: case eBOOLEAN:
{ {
aContext->recycler()->getBoolResult(returnParam.val.b, aResult); aContext->recycler()->getBoolResult(returnParam.val.b, aResult);
return NS_OK; return NS_OK;
} }
case NUMBER: case eNUMBER:
{ {
return aContext->recycler()->getNumberResult(returnParam.val.d, return aContext->recycler()->getNumberResult(returnParam.val.d,
aResult); aResult);
} }
case STRING: case eSTRING:
{ {
nsString *returned = static_cast<nsString*> nsString *returned = static_cast<nsString*>
(returnParam.val.p); (returnParam.val.p);

Просмотреть файл

@ -244,6 +244,10 @@ static txEXSLTFunctionDescriptor descriptTable[] =
}; };
#ifdef WINCE // WINCE defines this.
#undef DIFFERENCE
#endif
class txEXSLTFunctionCall : public FunctionCall class txEXSLTFunctionCall : public FunctionCall
{ {
public: public: