Schema Validation uses getter_AddRefs wrong. Bug 334007, r=aaronr+me, patch by doronr

This commit is contained in:
allan%beaufour.dk 2006-04-17 09:01:54 +00:00
Родитель afd0c3050f
Коммит b0341c9ddd
2 изменённых файлов: 12 добавлений и 6 удалений

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

@ -3828,7 +3828,7 @@ nsSchemaValidator::ValidateComplexParticle(nsIDOMNode* aNode,
rv = aSchemaParticle->GetMaxOccurs(&maxOccurs);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMNode>leftOvers;
nsCOMPtr<nsIDOMNode> leftOvers, tmpNode;
switch(particleType) {
case nsISchemaParticle::PARTICLE_TYPE_ELEMENT: {
@ -3845,7 +3845,9 @@ nsSchemaValidator::ValidateComplexParticle(nsIDOMNode* aNode,
// if not an element node, skip
if (nodeType != nsIDOMNode::ELEMENT_NODE) {
leftOvers->GetNextSibling(getter_AddRefs(leftOvers));
rv = leftOvers->GetNextSibling(getter_AddRefs(tmpNode));
NS_ENSURE_SUCCESS(rv, rv);
leftOvers = tmpNode;
continue;
}
@ -3860,8 +3862,11 @@ nsSchemaValidator::ValidateComplexParticle(nsIDOMNode* aNode,
NS_ENSURE_SUCCESS(rv, rv);
// set rest to the next element if node is valid
if (isValid)
leftOvers->GetNextSibling(getter_AddRefs(leftOvers));
if (isValid) {
rv = leftOvers->GetNextSibling(getter_AddRefs(tmpNode));
NS_ENSURE_SUCCESS(rv, rv);
leftOvers = tmpNode;
}
iterations++;
done = !isValid;
@ -4185,7 +4190,8 @@ nsSchemaValidator::ValidateComplexAll(nsIDOMNode* aStartNode,
} else {
// check if any of the particles didn't occur enough. We already checked
// if a particle is hit more than once
PRUint32 hits, particleMinOccurs, particleMaxOccurs;
PRUint32 hits = 0;
PRUint32 particleMinOccurs, particleMaxOccurs;
for (PRUint32 i = 0; i < particleCount; ++i) {
rv = aSchemaModelGroup->GetParticle(i, getter_AddRefs(particle));

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

@ -460,7 +460,7 @@ nsSchemaValidatorUtils::ParseSchemaTime(const nsAString & aStrValue,
PRUint32 usecval = strtoul(NS_ConvertUTF16toUTF8(usec).get(), &pEnd, 10);
// be carefull, empty usec returns 0
if (!usec.IsEmpty() > 0 && (usecval == 0 || usecval == ULONG_MAX)) {
if (!usec.IsEmpty() && (usecval == 0 || usecval == ULONG_MAX)) {
isValid = PR_FALSE;
} else {
aTime->hour = strtol(hour, &pEnd, 10);