diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index e9b8961349a..efb01baa37a 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -58,7 +58,7 @@ #include "nsInterfaceHashtable.h" #include "nsContentList.h" #include "nsGUIEvent.h" -#include "nsSupportsArray.h" +#include "nsCOMArray.h" // form submission #include "nsIFormSubmitObserver.h" @@ -396,7 +396,7 @@ public: private: nsHTMLFormElement* mForm; PRUint32 mElementsIndex; - nsSupportsArray mNotInElementsSorted; + nsCOMArray mNotInElementsSorted; PRUint32 mNotInElementsIndex; }; @@ -1637,7 +1637,7 @@ nsHTMLFormElement::GetNextRadioButton(const nsAString& aName, index = numRadios -1; } } - else if (++index >= numRadios) { + else if (++index >= (PRInt32)numRadios) { index = 0; } nsCOMPtr radioDOMNode; @@ -2046,7 +2046,6 @@ nsFormControlEnumerator::nsFormControlEnumerator(nsHTMLFormElement* aForm) // Go through the array and insert the element at the first place where // it is less than the element already in the array nsCOMPtr controlToAddNode = do_QueryInterface(controlToAdd); - nsCOMPtr existingNode; PRBool inserted = PR_FALSE; // Loop over all elements backwards (from indexToAdd to 0) // indexToAdd is equal to the array length because we've been adding to it @@ -2054,7 +2053,7 @@ nsFormControlEnumerator::nsFormControlEnumerator(nsHTMLFormElement* aForm) PRUint32 i = indexToAdd; while (i > 0) { i--; - existingNode = do_QueryElementAt(&mNotInElementsSorted, i); + nsCOMPtr existingNode = mNotInElementsSorted[i]; PRInt32 comparison; if (NS_FAILED(nsHTMLFormElement::CompareNodes(controlToAddNode, existingNode, @@ -2062,7 +2061,7 @@ nsFormControlEnumerator::nsFormControlEnumerator(nsHTMLFormElement* aForm) break; } if (comparison > 0) { - if (mNotInElementsSorted.InsertElementAt(controlToAdd, i+1)) { + if (mNotInElementsSorted.InsertObjectAt(controlToAddNode, i + 1)) { inserted = PR_TRUE; } break; @@ -2072,7 +2071,7 @@ nsFormControlEnumerator::nsFormControlEnumerator(nsHTMLFormElement* aForm) // If it wasn't inserted yet, it is greater than everything in the array // and must be appended. if (!inserted) { - if (!mNotInElementsSorted.InsertElementAt(controlToAdd,0)) { + if (!mNotInElementsSorted.InsertObjectAt(controlToAddNode, 0)) { break; } } @@ -2087,8 +2086,7 @@ nsFormControlEnumerator::HasMoreElements(PRBool* aHasMoreElements) if (mElementsIndex < len) { *aHasMoreElements = PR_TRUE; } else { - PRUint32 notInElementsLen; - mNotInElementsSorted.Count(¬InElementsLen); + PRUint32 notInElementsLen = mNotInElementsSorted.Count(); *aHasMoreElements = mNotInElementsIndex < notInElementsLen; } return NS_OK; @@ -2108,13 +2106,11 @@ nsFormControlEnumerator::GetNext(nsISupports** aNext) // If there are still controls in mNotInElementsSorted, determine whether said // control is before the current control in the array, and if so, choose it // instead - PRUint32 notInElementsLen; - mNotInElementsSorted.Count(¬InElementsLen); + PRUint32 notInElementsLen = mNotInElementsSorted.Count(); if (mNotInElementsIndex < notInElementsLen) { // Get the not-in-elements control - weak ref - nsCOMPtr formControl2 = - do_QueryElementAt(&mNotInElementsSorted, mNotInElementsIndex); + do_QueryInterface(mNotInElementsSorted[mNotInElementsIndex]); if (formControl) { // Both form controls are there. We have to compare them and see which diff --git a/content/xbl/src/nsBindingManager.cpp b/content/xbl/src/nsBindingManager.cpp index dd3d28cb5a5..6c4170e2588 100644 --- a/content/xbl/src/nsBindingManager.cpp +++ b/content/xbl/src/nsBindingManager.cpp @@ -58,7 +58,6 @@ #include "nsContentCID.h" #include "nsXMLDocument.h" #include "nsHTMLAtoms.h" -#include "nsSupportsArray.h" #include "nsITextContent.h" #include "nsIStreamListener.h" diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index 32f725dbfbe..d3d7168d4f7 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -64,7 +64,6 @@ #include "nsXMLDocument.h" #include "nsIDOMElement.h" #include "nsIDOMText.h" -#include "nsSupportsArray.h" #include "jsapi.h" #include "nsXBLService.h" #include "nsXBLInsertionPoint.h" diff --git a/content/xbl/src/nsXBLPrototypeBinding.cpp b/content/xbl/src/nsXBLPrototypeBinding.cpp index 2be6c8a7cf6..595e330d4f4 100644 --- a/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -58,7 +58,6 @@ #include "nsXMLDocument.h" #include "nsIDOMElement.h" #include "nsIDOMText.h" -#include "nsSupportsArray.h" #include "nsXBLService.h" #include "nsXBLBinding.h" #include "nsXBLInsertionPoint.h" diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp index e1ea09b53e2..bb219c7f58f 100644 --- a/content/xbl/src/nsXBLService.cpp +++ b/content/xbl/src/nsXBLService.cpp @@ -62,7 +62,6 @@ #include "nsContentCID.h" #include "nsXMLDocument.h" #include "nsHTMLAtoms.h" -#include "nsSupportsArray.h" #include "nsITextContent.h" #include "nsIMemory.h" #include "nsIObserverService.h"