Clean up nsICollection/nsSupportsArray {Append,Remove}Element return type (130544, r=dougt, sr=bienvenu).

This commit is contained in:
brendan%mozilla.org 2002-05-29 18:08:37 +00:00
parent 2fbaa70225
commit d133d09cb4
3 changed files with 886 additions and 925 deletions

File diff suppressed because it is too large Load Diff

View File

@ -48,8 +48,8 @@ interface nsICollection : nsISerializable
void QueryElementAt(in PRUint32 index, in nsIIDRef uuid,
[iid_is(uuid),retval] out nsQIResult result);
void SetElementAt(in PRUint32 index, in nsISupports item);
void AppendElement(in nsISupports item);
void RemoveElement(in nsISupports item);
[notxpcom] boolean AppendElement(in nsISupports item);
[notxpcom] boolean RemoveElement(in nsISupports item);
nsIEnumerator Enumerate();

View File

@ -73,12 +73,12 @@ public:
NS_IMETHOD SetElementAt(PRUint32 aIndex, nsISupports* value) {
return ReplaceElementAt(value, aIndex) ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHOD AppendElement(nsISupports *aElement) {
return InsertElementAt(aElement, mCount)/* ? NS_OK : NS_ERROR_FAILURE*/;
NS_IMETHOD_(PRBool) AppendElement(nsISupports *aElement) {
return InsertElementAt(aElement, mCount);
}
// XXX this is badly named - should be RemoveFirstElement
NS_IMETHOD RemoveElement(nsISupports *aElement) {
return RemoveElement(aElement, 0)/* ? NS_OK : NS_ERROR_FAILURE*/;
// NB: This may seem silly, but it implements nsICollection::RemoveElement.
NS_IMETHOD_(PRBool) RemoveElement(nsISupports *aElement) {
return RemoveElement(aElement, 0);
}
NS_IMETHOD_(PRBool) MoveElement(PRInt32 aFrom, PRInt32 aTo);
NS_IMETHOD Enumerate(nsIEnumerator* *result);