mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Fix error in XPath analyzer. Bug 296812, r=smaug+aaronr, a=mkaply
This commit is contained in:
parent
27e477cd1c
commit
99861d4dfc
@ -165,14 +165,21 @@ nsXFormsXPathAnalyzer::AnalyzeRecursively(nsIDOMNode *aContextNode,
|
||||
|
||||
if (aNode->mCon) {
|
||||
// Remove the leading /
|
||||
xp = Substring(*mCurExprString, aNode->mStartIndex + 1, aNode->mEndIndex - aNode->mStartIndex + 1);
|
||||
xp = Substring(*mCurExprString, aNode->mStartIndex + 1,
|
||||
aNode->mEndIndex - aNode->mStartIndex + 2);
|
||||
} else {
|
||||
xp = Substring(*mCurExprString, aNode->mStartIndex, aNode->mEndIndex - aNode->mStartIndex);
|
||||
xp = Substring(*mCurExprString, aNode->mStartIndex,
|
||||
aNode->mEndIndex - aNode->mStartIndex);
|
||||
}
|
||||
rv = mEvaluator->Evaluate(xp, aContextNode, mCurPosition, mCurSize,
|
||||
mResolver, nsIDOMXPathResult::ANY_TYPE,
|
||||
nsnull, getter_AddRefs(result));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
const PRUnichar *strings[] = { xp.get() };
|
||||
nsXFormsUtils::ReportError(NS_LITERAL_STRING("exprEvaluateError"),
|
||||
strings, 1, nsnull, nsnull);
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRUint16 type;
|
||||
rv = result->GetResultType(&type);
|
||||
|
@ -49,13 +49,28 @@
|
||||
*/
|
||||
class nsXFormsXPathNode {
|
||||
public:
|
||||
/** Children of the node */
|
||||
nsXFormsXPathNode* mChild;
|
||||
|
||||
/** Siblings to the node */
|
||||
nsXFormsXPathNode* mSibling;
|
||||
|
||||
/** The starting position of the node in the expression string */
|
||||
PRInt32 mStartIndex;
|
||||
|
||||
/** The ending position of the node in the expression string */
|
||||
PRInt32 mEndIndex;
|
||||
|
||||
/** @todo Write dox. (XXX) */
|
||||
PRBool mCon;
|
||||
|
||||
/** Is node a predicate? */
|
||||
PRBool mPredicate;
|
||||
|
||||
/** Is node a literal? */
|
||||
PRBool mLiteral;
|
||||
|
||||
/** Is node an index() call? */
|
||||
PRBool mIsIndex;
|
||||
|
||||
nsXFormsXPathNode(nsXFormsXPathNode* aParent, PRBool aContinue = PR_FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user