NS_RELEASE(option);
} else {        nsCOMPtr<nsIPresState> presState; nsCOMPtr<nsISupportsArray> value; nsresult res = GetPresState(getter_AddRefs(presState), getter_AddRefs(value));  if (NS_SUCCEEDED(res) && value) {   PRUint32 count = 0; value->Count(&count);    PRInt32 j=0; for (PRUint32 i=0; i<count; i++) { nsCOMPtr<nsISupports> suppval = getter_AddRefs(value->ElementAt(i)); if (suppval) { nsCOMPtr<nsISupportsPRInt32> thisVal = do_QueryInterface(suppval); if (thisVal) { res = thisVal->GetData(&j);  if (NS_SUCCEEDED(res) && j == oldIndex) { res = value->RemoveElementAt(i); break; } } else { res = NS_ERROR_UNEXPECTED; } if (!NS_SUCCEEDED(res)) break; break; } } }
nsHTMLOptionCollection::RemoveOption(nsIContent* aOption){  nsIDOMHTMLOptionElement* option;  if ((nsnull != aOption) &&      NS_SUCCEEDED(aOption->QueryInterface(NS_GET_IID(nsIDOMHTMLOptionElement), (void**)&option))) {    if (mElements.RemoveElement(option)) {      nsresult result;      NS_RELEASE2(option, result);    }    NS_RELEASE(option);  }}