if (!mRangeArray) return NS_ERROR_FAILURE; if (!aItem )
if (!aItem)
nsTypedSelection::RemoveItem(nsIDOMRange *aItem){  if (!mRangeArray)    return NS_ERROR_FAILURE;  if (!aItem )    return NS_ERROR_NULL_POINTER;  PRUint32 cnt;  nsresult rv = mRangeArray->Count(&cnt);  if (NS_FAILED(rv)) return rv;  for (PRUint32 i = 0; i < cnt;i++)  {    nsCOMPtr<nsISupports> indexIsupports = dont_AddRef(mRangeArray->ElementAt(i));    nsCOMPtr<nsISupports> isupp;    aItem->QueryInterface(NS_GET_IID(nsISupports),getter_AddRefs(isupp));    if (isupp.get() == indexIsupports.get())    {      mRangeArray->RemoveElementAt(i);      return NS_OK;    }  }  return NS_OK;}