Bug 324918: Make nsHTMLSelectElement deal better with options in unknown children. r=bz sr=jst

git-svn-id: svn://10.0.0.236/trunk@191454 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cvshook%sicking.cc
2006-03-01 01:10:20 +00:00
parent 6976e091db
commit 0d2d02e785
2 changed files with 189 additions and 104 deletions

View File

@@ -134,11 +134,14 @@ nsCOMArray_base::RemoveObject(nsISupports *aObject)
PRBool
nsCOMArray_base::RemoveObjectAt(PRInt32 aIndex)
{
nsISupports* element = ObjectAt(aIndex);
PRBool result = mArray.RemoveElementAt(aIndex);
if (result)
if (PRUint32(aIndex) < PRUint32(Count())) {
nsISupports* element = ObjectAt(aIndex);
NS_IF_RELEASE(element);
return result;
return mArray.RemoveElementAt(aIndex);
}
return PR_FALSE;
}
// useful for destructors