зеркало из https://github.com/mozilla/pjs.git
bug 204456, remove #defined errorcodes, r=sicking, sr=peterv, a=sspitzer
This commit is contained in:
Родитель
8365f44e6e
Коммит
b4fdef96bc
|
@ -46,10 +46,7 @@
|
|||
|
||||
#include "nsError.h"
|
||||
|
||||
#define NS_ERROR_XPATH_EVAL_FAILED NS_ERROR_FAILURE
|
||||
#define NS_ERROR_XPATH_PARSE_FAILED NS_ERROR_FAILURE
|
||||
#define NS_ERROR_XPATH_INVALID_ARG NS_ERROR_INVALID_ARG
|
||||
#define NS_ERROR_XSLT_INVALID_URL NS_ERROR_INVALID_ARG
|
||||
|
||||
#define NS_XSLT_GET_NEW_HANDLER \
|
||||
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_XSLT, 1)
|
||||
|
|
|
@ -171,7 +171,7 @@ nsresult nsXPathEvaluator::ParseContextImpl::resolveFunctionCall(nsIAtom* aName,
|
|||
PRInt32 aID,
|
||||
FunctionCall*& aFn)
|
||||
{
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
}
|
||||
|
||||
PRBool nsXPathEvaluator::ParseContextImpl::caseInsensitiveNameTests()
|
||||
|
|
|
@ -75,7 +75,7 @@ ExprResult* FilterExpr::evaluate(txIEvalContext* aContext)
|
|||
// We can't filter a non-nodeset
|
||||
nsAutoString err(NS_LITERAL_STRING("Expecting nodeset as result of: "));
|
||||
expr->toString(err);
|
||||
aContext->receiveError(err, NS_ERROR_XPATH_EVAL_FAILED);
|
||||
aContext->receiveError(err, NS_ERROR_XSLT_NODESET_EXPECTED);
|
||||
delete exprResult;
|
||||
return new NodeSet;
|
||||
}
|
||||
|
|
|
@ -519,8 +519,7 @@ txExecutionState::retrieveDocument(const nsAString& uri,
|
|||
|
||||
if (NS_FAILED(rv) || !xmlDoc) {
|
||||
receiveError(NS_LITERAL_STRING("Couldn't load document '") +
|
||||
docUrl + NS_LITERAL_STRING("': ") + errMsg,
|
||||
NS_ERROR_XSLT_INVALID_URL);
|
||||
docUrl + NS_LITERAL_STRING("': ") + errMsg, rv);
|
||||
return NULL;
|
||||
}
|
||||
// add to list of documents
|
||||
|
|
|
@ -167,7 +167,7 @@ ExprResult* txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
nsAutoString err(INVALID_PARAM_VALUE);
|
||||
toString(err);
|
||||
aContext->receiveError(err,
|
||||
NS_ERROR_XPATH_EVAL_FAILED);
|
||||
NS_ERROR_XPATH_INVALID_ARG);
|
||||
return new StringResult(err);
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ ExprResult* txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
nsAutoString err(INVALID_PARAM_VALUE);
|
||||
toString(err);
|
||||
aContext->receiveError(err,
|
||||
NS_ERROR_XPATH_EVAL_FAILED);
|
||||
NS_ERROR_XPATH_INVALID_ARG);
|
||||
return new StringResult(err);
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ ExprResult* txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
nsAutoString err(INVALID_PARAM_VALUE);
|
||||
toString(err);
|
||||
aContext->receiveError(err,
|
||||
NS_ERROR_XPATH_EVAL_FAILED);
|
||||
NS_ERROR_XPATH_INVALID_ARG);
|
||||
return new StringResult(err);
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ nsresult txPatternParser::createUnionPattern(ExprLexer& aLexer,
|
|||
|
||||
if (type != Token::UNION_OP) {
|
||||
delete locPath;
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
}
|
||||
|
||||
txUnionPattern* unionPattern = new txUnionPattern();
|
||||
|
@ -112,7 +112,7 @@ nsresult txPatternParser::createUnionPattern(ExprLexer& aLexer,
|
|||
|
||||
if (type != Token::END) {
|
||||
delete unionPattern;
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
}
|
||||
|
||||
aPattern = unionPattern;
|
||||
|
@ -233,10 +233,10 @@ nsresult txPatternParser::createIdPattern(ExprLexer& aLexer,
|
|||
// check for '(' Literal ')'
|
||||
if (aLexer.nextToken()->type != Token::L_PAREN &&
|
||||
aLexer.peek()->type != Token::LITERAL)
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
const nsString& value = aLexer.nextToken()->value;
|
||||
if (aLexer.nextToken()->type != Token::R_PAREN)
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
aPattern = new txIdPattern(value);
|
||||
return aPattern ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -248,17 +248,17 @@ nsresult txPatternParser::createKeyPattern(ExprLexer& aLexer,
|
|||
// check for '(' Literal, Literal ')'
|
||||
if (aLexer.nextToken()->type != Token::L_PAREN &&
|
||||
aLexer.peek()->type != Token::LITERAL)
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
const nsString& key = aLexer.nextToken()->value;
|
||||
if (aLexer.nextToken()->type != Token::COMMA &&
|
||||
aLexer.peek()->type != Token::LITERAL)
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
const nsString& value = aLexer.nextToken()->value;
|
||||
if (aLexer.nextToken()->type != Token::R_PAREN)
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
|
||||
if (!XMLUtils::isValidQName(key))
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
nsCOMPtr<nsIAtom> prefix, localName;
|
||||
PRInt32 namespaceID;
|
||||
nsresult rv = resolveQName(key, getter_AddRefs(prefix), aContext,
|
||||
|
@ -285,7 +285,7 @@ nsresult txPatternParser::createStepPattern(ExprLexer& aLexer,
|
|||
else if (!TX_StringEqualsAtom(tok->value, txXPathAtoms::child)) {
|
||||
// all done already for CHILD_AXIS, for all others
|
||||
// XXX report unexpected axis error
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
}
|
||||
aLexer.nextToken();
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ nsresult txPatternParser::createStepPattern(ExprLexer& aLexer,
|
|||
nodeTest = createNodeTypeTest(aLexer);
|
||||
if (!nodeTest) {
|
||||
// XXX error report NodeTest expected
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,7 +335,7 @@ nsresult txPatternParser::createStepPattern(ExprLexer& aLexer,
|
|||
nodeTest = 0;
|
||||
if (!parsePredicates(step, aLexer, aContext)) {
|
||||
delete step;
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
return NS_ERROR_XPATH_PARSE_FAILURE;
|
||||
}
|
||||
|
||||
aPattern = step;
|
||||
|
|
Загрузка…
Ссылка в новой задаче