diff --git a/extensions/xforms/Makefile.in b/extensions/xforms/Makefile.in index 11c14d444505..4ec22ca9dc7c 100644 --- a/extensions/xforms/Makefile.in +++ b/extensions/xforms/Makefile.in @@ -105,7 +105,6 @@ CPPSRCS = \ nsXFormsAtoms.cpp \ nsXFormsModule.cpp \ nsXFormsMDGEngine.cpp \ - nsXFormsMDGSet.cpp \ nsXFormsXPathAnalyzer.cpp \ nsXFormsXPathNode.cpp \ nsXFormsXPathParser.cpp \ diff --git a/extensions/xforms/nsIXFormsControl.idl b/extensions/xforms/nsIXFormsControl.idl index e608759e3efa..9bc5ba2e2a8e 100644 --- a/extensions/xforms/nsIXFormsControl.idl +++ b/extensions/xforms/nsIXFormsControl.idl @@ -38,9 +38,13 @@ #include "nsIXFormsContextControl.idl" -interface nsIArray; interface nsIDOMNode; interface nsIDOMElement; +%{C++ + #include "nsCOMArray.h" +%} + +[ptr] native nsCOMArrayPtr(nsCOMArray); /** * Interface implemented by all XForms form control classes. @@ -79,11 +83,8 @@ interface nsIXFormsControl : nsIXFormsContextControl * nodes, all @owned attributes on /share nodes, and all /me nodes. * * @note The array MUST be sorted, pointer-order, ascending. - * - * @bug Should use nsCOMArray - * @see https://bugzilla.mozilla.org/show_bug.cgi?id=278369 */ - readonly attribute nsIArray dependencies; + readonly attribute nsCOMArrayPtr dependencies; /** * Get the element that should receive events for the control. diff --git a/extensions/xforms/nsXFormsControlStub.cpp b/extensions/xforms/nsXFormsControlStub.cpp index a568c5fb2599..3ce89d8982fc 100644 --- a/extensions/xforms/nsXFormsControlStub.cpp +++ b/extensions/xforms/nsXFormsControlStub.cpp @@ -92,9 +92,10 @@ nsXFormsControlStub::GetBoundNode(nsIDOMNode **aBoundNode) } NS_IMETHODIMP -nsXFormsControlStub::GetDependencies(nsIArray **aDependencies) +nsXFormsControlStub::GetDependencies(nsCOMArray **aDependencies) { - NS_IF_ADDREF(*aDependencies = mDependencies); + if (aDependencies) + *aDependencies = &mDependencies; return NS_OK; } @@ -153,15 +154,9 @@ nsXFormsControlStub::ProcessNodeBinding(const nsString &aBindingAttr, nsIDOMXPathResult **aResult, nsIModelElementPrivate **aModel) { - nsresult rv; + mDependencies.Clear(); - if (!mDependencies) { - rv = NS_NewArray(getter_AddRefs(mDependencies)); - } else { - rv = mDependencies->Clear(); - } - NS_ENSURE_SUCCESS(rv, rv); - + nsresult rv; rv = nsXFormsUtils::EvaluateNodeBinding(mElement, kElementFlags, aBindingAttr, @@ -169,7 +164,7 @@ nsXFormsControlStub::ProcessNodeBinding(const nsString &aBindingAttr, aResultType, getter_AddRefs(mModel), aResult, - mDependencies); + &mDependencies); if (mModel) { mModel->AddFormControl(this); diff --git a/extensions/xforms/nsXFormsControlStub.h b/extensions/xforms/nsXFormsControlStub.h index d9364fb2efdf..3d82333d6f5b 100644 --- a/extensions/xforms/nsXFormsControlStub.h +++ b/extensions/xforms/nsXFormsControlStub.h @@ -39,7 +39,6 @@ #ifndef nsXFormsControlStub_h_ #define nsXFormsControlStub_h_ -#include "nsArray.h" #include "nsCOMPtr.h" #include "nsString.h" @@ -86,7 +85,7 @@ public: // nsIXFormsControl NS_IMETHOD GetBoundNode(nsIDOMNode **aBoundNode); - NS_IMETHOD GetDependencies(nsIArray **aDependencies); + NS_IMETHOD GetDependencies(nsCOMArray **aDependencies); NS_IMETHOD GetElement(nsIDOMElement **aElement); NS_IMETHOD ResetBoundNode(); NS_IMETHOD Bind(); @@ -126,7 +125,7 @@ protected: nsCOMPtr mBoundNode; /** Array of nsIDOMNodes that the control depends on. */ - nsCOMPtr mDependencies; + nsCOMArray mDependencies; /** The model for the control */ nsCOMPtr mModel; diff --git a/extensions/xforms/nsXFormsMDGEngine.cpp b/extensions/xforms/nsXFormsMDGEngine.cpp index 0191377e3d78..abd126ea9efc 100644 --- a/extensions/xforms/nsXFormsMDGEngine.cpp +++ b/extensions/xforms/nsXFormsMDGEngine.cpp @@ -46,6 +46,7 @@ #include "nsIDOMXPathResult.h" #include "nsDeque.h" #include "nsIModelElementPrivate.h" +#include "nsXFormsUtils.h" #ifdef DEBUG //# define DEBUG_XF_MDG @@ -149,13 +150,13 @@ nsXFormsMDGEngine::Init(nsIModelElementPrivate *aModel) } nsresult -nsXFormsMDGEngine::AddMIP(ModelItemPropName aType, - nsIDOMXPathExpression *aExpression, - nsXFormsMDGSet *aDependencies, - PRBool aDynFunc, - nsIDOMNode *aContextNode, - PRInt32 aContextPos, - PRInt32 aContextSize) +nsXFormsMDGEngine::AddMIP(ModelItemPropName aType, + nsIDOMXPathExpression *aExpression, + nsCOMArray *aDependencies, + PRBool aDynFunc, + nsIDOMNode *aContextNode, + PRInt32 aContextPos, + PRInt32 aContextSize) { NS_ENSURE_ARG(aContextNode); @@ -193,7 +194,7 @@ nsXFormsMDGEngine::AddMIP(ModelItemPropName aType, nsCOMPtr dep_domnode; nsXFormsMDGNode* dep_gnode; for (PRInt32 i = 0; i < aDependencies->Count(); ++i) { - dep_domnode = aDependencies->GetNode(i); + dep_domnode = aDependencies->ObjectAt(i); if (!dep_domnode) { return NS_ERROR_NULL_POINTER; } @@ -241,9 +242,7 @@ nsXFormsMDGEngine::MarkNodeAsChanged(nsIDOMNode* aContextNode) NS_ENSURE_TRUE(mGraph.AppendElement(n), NS_ERROR_OUT_OF_MEMORY); } - NS_ENSURE_TRUE(mMarkedNodes.AddNode(aContextNode), NS_ERROR_FAILURE); - - return NS_OK; + return mMarkedNodes.AppendObject(aContextNode); } #ifdef DEBUG_beaufour @@ -292,7 +291,7 @@ nsXFormsMDGEngine::PrintDot(const char* aFile) #endif nsresult -nsXFormsMDGEngine::Recalculate(nsXFormsMDGSet* aChangedNodes) +nsXFormsMDGEngine::Recalculate(nsCOMArray *aChangedNodes) { NS_ENSURE_ARG(aChangedNodes); @@ -301,7 +300,7 @@ nsXFormsMDGEngine::Recalculate(nsXFormsMDGSet* aChangedNodes) aChangedNodes->Count()); #endif - NS_ENSURE_TRUE(aChangedNodes->AddSet(mMarkedNodes), NS_ERROR_OUT_OF_MEMORY); + NS_ENSURE_TRUE(aChangedNodes->AppendObjects(mMarkedNodes), NS_ERROR_OUT_OF_MEMORY); mMarkedNodes.Clear(); @@ -372,7 +371,7 @@ nsXFormsMDGEngine::Recalculate(nsXFormsMDGSet* aChangedNodes) PR_FALSE, PR_TRUE); if (NS_SUCCEEDED(rv)) { - NS_ENSURE_TRUE(aChangedNodes->AddNode(g->mContextNode), + NS_ENSURE_TRUE(aChangedNodes->AppendObject(g->mContextNode), NS_ERROR_FAILURE); } } @@ -393,7 +392,7 @@ nsXFormsMDGEngine::Recalculate(nsXFormsMDGSet* aChangedNodes) if (ns->IsConstraint() != constraint) { ns->Set(eFlag_CONSTRAINT, constraint); ns->Set(eFlag_DISPATCH_VALID_CHANGED, PR_TRUE); - NS_ENSURE_TRUE(aChangedNodes->AddNode(g->mContextNode), + NS_ENSURE_TRUE(aChangedNodes->AppendObject(g->mContextNode), NS_ERROR_FAILURE); } @@ -431,7 +430,7 @@ nsXFormsMDGEngine::Recalculate(nsXFormsMDGSet* aChangedNodes) NS_ENSURE_SUCCESS(rv, rv); if (didChange) { - NS_ENSURE_TRUE(aChangedNodes->AddNode(g->mContextNode), + NS_ENSURE_TRUE(aChangedNodes->AppendObject(g->mContextNode), NS_ERROR_FAILURE); } } @@ -456,7 +455,7 @@ nsXFormsMDGEngine::Recalculate(nsXFormsMDGSet* aChangedNodes) g->MarkClean(); } - aChangedNodes->MakeUnique(); + nsXFormsUtils::MakeUniqueAndSort(aChangedNodes); #ifdef DEBUG_XF_MDG printf("\taChangedNodes: %d\n", aChangedNodes->Count()); @@ -950,11 +949,11 @@ nsXFormsMDGEngine::ComputeMIP(eFlag_t aStateFlag, } nsresult -nsXFormsMDGEngine::ComputeMIPWithInheritance(eFlag_t aStateFlag, - eFlag_t aDispatchFlag, - eFlag_t aInheritanceFlag, - nsXFormsMDGNode *aNode, - nsXFormsMDGSet *aSet) +nsXFormsMDGEngine::ComputeMIPWithInheritance(eFlag_t aStateFlag, + eFlag_t aDispatchFlag, + eFlag_t aInheritanceFlag, + nsXFormsMDGNode *aNode, + nsCOMArray *aSet) { nsresult rv; PRBool didChange; @@ -967,7 +966,7 @@ nsXFormsMDGEngine::ComputeMIPWithInheritance(eFlag_t aStateFlag, if ( !(aStateFlag == eFlag_READONLY && ns->Test(aInheritanceFlag)) || (aStateFlag == eFlag_RELEVANT && ns->Test(aInheritanceFlag)) ) { - NS_ENSURE_TRUE(aSet->AddNode(aNode->mContextNode), + NS_ENSURE_TRUE(aSet->AppendObject(aNode->mContextNode), NS_ERROR_FAILURE); rv = AttachInheritance(aSet, aNode->mContextNode, @@ -980,10 +979,10 @@ nsXFormsMDGEngine::ComputeMIPWithInheritance(eFlag_t aStateFlag, } nsresult -nsXFormsMDGEngine::AttachInheritance(nsXFormsMDGSet *aSet, - nsIDOMNode *aSrc, - PRBool aState, - eFlag_t aStateFlag) +nsXFormsMDGEngine::AttachInheritance(nsCOMArray *aSet, + nsIDOMNode *aSrc, + PRBool aState, + eFlag_t aStateFlag) { NS_ENSURE_ARG(aSrc); @@ -1043,7 +1042,7 @@ nsXFormsMDGEngine::AttachInheritance(nsXFormsMDGSet *aSet, if (updateNode) { rv = AttachInheritance(aSet, node, aState, aStateFlag); NS_ENSURE_SUCCESS(rv, rv); - NS_ENSURE_TRUE(aSet->AddNode(node), NS_ERROR_FAILURE); + NS_ENSURE_TRUE(aSet->AppendObject(node), NS_ERROR_FAILURE); updateNode = PR_FALSE; } } diff --git a/extensions/xforms/nsXFormsMDGEngine.h b/extensions/xforms/nsXFormsMDGEngine.h index 045a4a32fcee..08bb11929e16 100644 --- a/extensions/xforms/nsXFormsMDGEngine.h +++ b/extensions/xforms/nsXFormsMDGEngine.h @@ -42,13 +42,13 @@ #include "nscore.h" #include "nsClassHashtable.h" +#include "nsCOMArray.h" #include "nsCOMPtr.h" #include "nsVoidArray.h" #include "nsIDOMNode.h" #include "nsXFormsTypes.h" -#include "nsXFormsMDGSet.h" #include "nsXFormsNodeState.h" #include "nsIModelElementPrivate.h" @@ -177,10 +177,9 @@ protected: nsIModelElementPrivate *mModel; /** - * Set of nodes that are marked as changed, and should be included in - * recalculation + * Nodes that are marked as changed, and should be included in recalculation */ - nsXFormsMDGSet mMarkedNodes; + nsCOMArray mMarkedNodes; /** Number of nodes in the graph */ PRInt32 mNodesInGraph; @@ -289,11 +288,11 @@ protected: * @param aNode The context node * @param aSet Set of the nodes influenced by operation */ - nsresult ComputeMIPWithInheritance(eFlag_t aStateFlag, - eFlag_t aDispatchFlag, - eFlag_t aInheritanceFlag, - nsXFormsMDGNode *aNode, - nsXFormsMDGSet *aSet); + nsresult ComputeMIPWithInheritance(eFlag_t aStateFlag, + eFlag_t aDispatchFlag, + eFlag_t aInheritanceFlag, + nsXFormsMDGNode *aNode, + nsCOMArray *aSet); /** * Attaches inheritance to all children of a given node @@ -303,10 +302,10 @@ protected: * @param aState The state of the flag * @param aStateFlag The flag */ - nsresult AttachInheritance(nsXFormsMDGSet *aSet, - nsIDOMNode *aSrc, - PRBool aState, - eFlag_t aStateFlag); + nsresult AttachInheritance(nsCOMArray *aSet, + nsIDOMNode *aSrc, + PRBool aState, + eFlag_t aStateFlag); /** * Invalidate the information, ie. mark all nodes as dirty. @@ -356,13 +355,13 @@ public: * @param aContextPos The context positions of aExpression * @param aContextSize The context size for aExpression */ - nsresult AddMIP(ModelItemPropName aType, - nsIDOMXPathExpression *aExpression, - nsXFormsMDGSet *aDependencies, - PRBool aDynFunc, - nsIDOMNode *aContextNode, - PRInt32 aContextPos, - PRInt32 aContextSize); + nsresult AddMIP(ModelItemPropName aType, + nsIDOMXPathExpression *aExpression, + nsCOMArray *aDependencies, + PRBool aDynFunc, + nsIDOMNode *aContextNode, + PRInt32 aContextPos, + PRInt32 aContextSize); /** * Recalculate the MDG. @@ -371,7 +370,7 @@ public: * * @note aChangedNodes are unique and sorted in pointer-order, ascending. */ - nsresult Recalculate(nsXFormsMDGSet *aChangedNodes); + nsresult Recalculate(nsCOMArray *aChangedNodes); /** * Rebuilds the MDG. diff --git a/extensions/xforms/nsXFormsModelElement.cpp b/extensions/xforms/nsXFormsModelElement.cpp index 74fb6abb0830..87442c8356ed 100644 --- a/extensions/xforms/nsXFormsModelElement.cpp +++ b/extensions/xforms/nsXFormsModelElement.cpp @@ -573,12 +573,9 @@ nsXFormsModelElement::Revalidate() control->GetBoundNode(getter_AddRefs(boundNode)); // Get dependencies - nsCOMPtr deps; - control->GetDependencies(getter_AddRefs(deps)); - PRUint32 depCount = 0; - if (deps) { - deps->GetLength(&depCount); - } + nsCOMArray *deps = nsnull; + control->GetDependencies(&deps); + PRUint32 depCount = deps ? deps->Count() : 0; #ifdef DEBUG_MODEL nsCOMPtr controlElement; @@ -604,7 +601,7 @@ nsXFormsModelElement::Revalidate() PRBool refresh = PR_FALSE; for (PRInt32 j = 0; j < mChangedNodes.Count(); ++j) { - curChanged = mChangedNodes.GetNode(j); + curChanged = mChangedNodes[j]; if (curChanged == boundNode) { refresh = PR_TRUE; @@ -617,7 +614,7 @@ nsXFormsModelElement::Revalidate() } while (depPos < depCount && (void*) curChanged > (void*) curDep) { - curDep = do_QueryElementAt(deps, depPos); + curDep = deps->ObjectAt(depPos); ++depPos; } @@ -1196,7 +1193,7 @@ nsXFormsModelElement::ProcessBind(nsIXFormsXPathEvaluator *aEvaluator, // Iterate over resultset - nsXFormsMDGSet set; + nsCOMArray deps; nsCOMPtr node; PRUint32 snapItem; for (snapItem = 0; snapItem < snapLen; ++snapItem) { @@ -1265,14 +1262,14 @@ nsXFormsModelElement::ProcessBind(nsIXFormsXPathEvaluator *aEvaluator, // Get node dependencies nsAutoPtr xNode(parser.Parse(propStrings[j])); - set.Clear(); - rv = analyzer.Analyze(node, xNode, expr, &propStrings[j], &set); + deps.Clear(); + rv = analyzer.Analyze(node, xNode, expr, &propStrings[j], &deps); NS_ENSURE_SUCCESS(rv, rv); // Insert into MDG rv = mMDG.AddMIP((ModelItemPropName) j, expr, - &set, + &deps, parser.UsesDynamicFunc(), node, snapItem + 1, diff --git a/extensions/xforms/nsXFormsModelElement.h b/extensions/xforms/nsXFormsModelElement.h index 8108f0b1a24b..d15ecc326137 100644 --- a/extensions/xforms/nsXFormsModelElement.h +++ b/extensions/xforms/nsXFormsModelElement.h @@ -149,7 +149,7 @@ private: * List of changed nodes, ie. nodes that have not been informed about * changes yet */ - nsXFormsMDGSet mChangedNodes; + nsCOMArray mChangedNodes; /* Controls that need to a Refresh() */ nsVoidArray mControlsNeedingRefresh; diff --git a/extensions/xforms/nsXFormsUtils.cpp b/extensions/xforms/nsXFormsUtils.cpp index 84805c8debe7..4d31b6f49295 100644 --- a/extensions/xforms/nsXFormsUtils.cpp +++ b/extensions/xforms/nsXFormsUtils.cpp @@ -66,7 +66,6 @@ #include "nsXFormsXPathAnalyzer.h" #include "nsXFormsXPathParser.h" #include "nsXFormsXPathNode.h" -#include "nsXFormsMDGSet.h" #include "nsIDOMXPathExpression.h" #include "nsArray.h" @@ -338,13 +337,13 @@ nsXFormsUtils::GetModel(nsIDOMElement *aElement, } /* static */ already_AddRefed -nsXFormsUtils::EvaluateXPath(const nsAString &aExpression, - nsIDOMNode *aContextNode, - nsIDOMNode *aResolverNode, - PRUint16 aResultType, - PRInt32 aContextPosition, - PRInt32 aContextSize, - nsXFormsMDGSet *aSet) +nsXFormsUtils::EvaluateXPath(const nsAString &aExpression, + nsIDOMNode *aContextNode, + nsIDOMNode *aResolverNode, + PRUint16 aResultType, + PRInt32 aContextPosition, + PRInt32 aContextSize, + nsCOMArray *aSet) { nsCOMPtr doc; aContextNode->GetOwnerDocument(getter_AddRefs(doc)); @@ -435,7 +434,7 @@ nsXFormsUtils::EvaluateNodeBinding(nsIDOMElement *aElement, PRUint16 aResultType, nsIModelElementPrivate **aModel, nsIDOMXPathResult **aResult, - nsIMutableArray *aDeps) + nsCOMArray *aDeps) { if (!aElement || !aModel || !aResult) { return NS_OK; @@ -507,20 +506,13 @@ nsXFormsUtils::EvaluateNodeBinding(nsIDOMElement *aElement, } // Evaluate |expr| - nsXFormsMDGSet set; nsCOMPtr res = EvaluateXPath(expr, contextNode, aElement, aResultType, contextSize, contextPosition, - aDeps ? &set : nsnull); - - if (res && aDeps) { - for (PRInt32 i = 0; i < set.Count(); ++i) { - aDeps->AppendElement(set.GetNode(i), PR_FALSE); - } - } + aDeps); res.swap(*aResult); // exchanges ref @@ -961,6 +953,30 @@ nsXFormsUtils::FocusControl(nsIDOMElement *aElement) return ret; } +int +sortFunc(nsIDOMNode *aNode1, nsIDOMNode *aNode2, void *aArg) +{ + return (void*) aNode1 < (void*) aNode2; +} + +/* static */ void +nsXFormsUtils::MakeUniqueAndSort(nsCOMArray *aArray) +{ + if (!aArray) + return; + + aArray->Sort(sortFunc, nsnull); + + PRInt32 pos = 0; + while (pos + 1 < aArray->Count()) { + if (aArray->ObjectAt(pos) == aArray->ObjectAt(pos + 1)) { + aArray->RemoveObjectAt(pos + 1); + } else { + ++pos; + } + } +} + /* static */ nsresult nsXFormsUtils::GetInstanceNodeForData(nsIDOMNode *aInstanceDataNode, nsIModelElementPrivate *aModel, diff --git a/extensions/xforms/nsXFormsUtils.h b/extensions/xforms/nsXFormsUtils.h index b88650894053..6394aa16d032 100644 --- a/extensions/xforms/nsXFormsUtils.h +++ b/extensions/xforms/nsXFormsUtils.h @@ -42,15 +42,15 @@ #include "prtypes.h" #include "nsCOMPtr.h" +#include "nsCOMArray.h" +#include "nsIDOMNode.h" #include "nsIDOMXPathResult.h" #include "nsIModelElementPrivate.h" -class nsIDOMNode; class nsIDOMElement; class nsIXFormsModelElement; class nsIURI; class nsString; -class nsXFormsMDGSet; class nsIMutableArray; #define NS_NAMESPACE_XFORMS "http://www.w3.org/2002/xforms" @@ -209,7 +209,7 @@ public: PRUint16 aResultType, nsIModelElementPrivate **aModel, nsIDOMXPathResult **aResult, - nsIMutableArray *aDeps = nsnull); + nsCOMArray *aDeps = nsnull); /** * Given a bind element |aBindElement|, find the model and the context node @@ -228,13 +228,13 @@ public: * namespace resolver, and result type. */ static NS_HIDDEN_(already_AddRefed) - EvaluateXPath(const nsAString &aExpression, - nsIDOMNode *aContextNode, - nsIDOMNode *aResolverNode, - PRUint16 aResultType, - PRInt32 aContextPosition = 1, - PRInt32 aContextSize = 1, - nsXFormsMDGSet *aSet = nsnull); + EvaluateXPath(const nsAString &aExpression, + nsIDOMNode *aContextNode, + nsIDOMNode *aResolverNode, + PRUint16 aResultType, + PRInt32 aContextPosition = 1, + PRInt32 aContextSize = 1, + nsCOMArray *aSet = nsnull); /** * Given a node in the instance data, get its string value according @@ -330,6 +330,11 @@ public: */ static NS_HIDDEN_(PRBool) FocusControl(nsIDOMElement *aElement); + /** + * Sorts the array and removes duplicate entries + */ + static NS_HIDDEN_(void) MakeUniqueAndSort(nsCOMArray *aArray); + /** * Returns the for a given instance data node. */ diff --git a/extensions/xforms/nsXFormsXPathAnalyzer.cpp b/extensions/xforms/nsXFormsXPathAnalyzer.cpp index 29e844df4a75..c8cc4006e2fd 100644 --- a/extensions/xforms/nsXFormsXPathAnalyzer.cpp +++ b/extensions/xforms/nsXFormsXPathAnalyzer.cpp @@ -39,6 +39,7 @@ #include "nsXFormsXPathAnalyzer.h" #include "nsIDOMXPathResult.h" +#include "nsXFormsUtils.h" #ifdef DEBUG //#define DEBUG_XF_ANALYZER @@ -65,7 +66,7 @@ nsXFormsXPathAnalyzer::Analyze(nsIDOMNode *aContextNode, const nsXFormsXPathNode *aNode, nsIDOMXPathExpression *aExpression, const nsAString *aExprString, - nsXFormsMDGSet *aSet) + nsCOMArray *aSet) { NS_ENSURE_ARG(aContextNode); NS_ENSURE_ARG(aNode); @@ -90,7 +91,7 @@ nsXFormsXPathAnalyzer::Analyze(nsIDOMNode *aContextNode, NS_ENSURE_SUCCESS(rv, rv); // Besides making the set a set, it also makes it sorted. - aSet->MakeUnique(); + nsXFormsUtils::MakeUniqueAndSort(aSet); return NS_OK; } @@ -196,7 +197,7 @@ nsXFormsXPathAnalyzer::AnalyzeRecursively(nsIDOMNode *aContextNode, #ifdef DEBUG_XF_ANALYZER printf("collecting '%s'\n", NS_ConvertUCS2toUTF8(xp).get()); #endif - mCurSet->AddNode(node); + mCurSet->AppendObject(node); } rv = AnalyzeRecursively(node, aNode->mChild, aIndent + 1); } diff --git a/extensions/xforms/nsXFormsXPathAnalyzer.h b/extensions/xforms/nsXFormsXPathAnalyzer.h index 9a24a5971b1f..85d00c3c9238 100644 --- a/extensions/xforms/nsXFormsXPathAnalyzer.h +++ b/extensions/xforms/nsXFormsXPathAnalyzer.h @@ -39,11 +39,11 @@ #include "nscore.h" #include "nsCOMPtr.h" +#include "nsCOMArray.h" #include "nsXFormsXPathNode.h" #include "nsIDOMXPathExpression.h" #include "nsIXFormsXPathEvaluator.h" #include "nsIDOMXPathNSResolver.h" -#include "nsXFormsMDGSet.h" #include "nsIDOMNode.h" #include "nsCOMPtr.h" #include "nsString.h" @@ -60,7 +60,7 @@ private: nsCOMPtr mEvaluator; nsCOMPtr mResolver; - nsXFormsMDGSet *mCurSet; + nsCOMArray *mCurSet; nsCOMPtr mCurExpression; const nsAString *mCurExprString; @@ -77,5 +77,5 @@ public: const nsXFormsXPathNode *aNode, nsIDOMXPathExpression *aExpression, const nsAString *aExprString, - nsXFormsMDGSet *aSet); + nsCOMArray *aSet); };