XForms bug 301413 - Valid bindings generate MDG loop warning. patch my beaufour, r=smaug/me a=mkaply

This commit is contained in:
doronr%us.ibm.com 2005-07-25 14:29:47 +00:00
parent 92a3b09330
commit bbb382b955

View File

@ -198,8 +198,14 @@ nsXFormsMDGEngine::AddMIP(ModelItemPropName aType,
if (!dep_domnode) {
return NS_ERROR_NULL_POINTER;
}
#ifdef DEBUG_XF_MDG
printf("\tDependency #%2d: %p\n", i, (void*) dep_domnode);
#endif
dep_gnode = GetNode(dep_domnode, aType);
// Get calculate graph node for the dependency (only a calculate
// property can influence another MIP).
dep_gnode = GetNode(dep_domnode, eModel_calculate);
if (!dep_gnode) {
return NS_ERROR_OUT_OF_MEMORY;
}
@ -209,6 +215,8 @@ nsXFormsMDGEngine::AddMIP(ModelItemPropName aType,
continue;
}
// Add this node as a successor to the dependency (ie. the dependency
// should be (re-)calculated before this node)
dep_gnode->mSuc.AppendElement(newnode);
newnode->mCount++;
}
@ -542,6 +550,11 @@ nsXFormsMDGEngine::Rebuild()
}
}
#ifdef DEBUG_XF_MDG
printf("\tmGraph.Count() = %2d\n", mGraph.Count());
printf("\tmNodesInGraph = %2d\n", mNodesInGraph);
#endif
if (mGraph.Count() != mNodesInGraph) {
NS_WARNING("XForms: There are loops in the MDG\n");
rv = NS_ERROR_ABORT;