nsCOMPtr<nsISupports> isupp; nsresult result = aItem->QueryInterface(nsCOMTypeInfo<nsISupports>::GetIID(), getter_AddRefs(isupp)); if (NS_FAILED(result)) return result; result = mRangeArray->AppendElement(isupp);
nsresult result; nsCOMPtr<nsISupports> isupp = do_QueryInterface(aItem, &result); if (NS_SUCCEEDED(result)) { result = mRangeArray->AppendElement(isupp); }
nsDOMSelection::AddItem(nsIDOMRange *aItem){  if (!mRangeArray)    return NS_ERROR_FAILURE;  if (!aItem)    return NS_ERROR_NULL_POINTER;  nsCOMPtr<nsISupports> isupp;  nsresult result = aItem->QueryInterface(nsCOMTypeInfo<nsISupports>::GetIID(), getter_AddRefs(isupp));   if (NS_FAILED(result))    return result;  result = mRangeArray->AppendElement(isupp);  return result;}