nsresult result; nsCOMPtr<nsISupports> isupports = do_QueryInterface(aNewListener , &result); if (NS_SUCCEEDED(result)) result = mSelectionListeners->AppendElement(isupports) ? NS_OK : NS_ERROR_FAILURE; return result;
return mSelectionListeners.AppendObject(aNewListener) ? NS_OK : NS_ERROR_FAILURE;
nsTypedSelection::AddSelectionListener(nsISelectionListener* aNewListener){  if (!mSelectionListeners)    return NS_ERROR_FAILURE;  if (!aNewListener)    return NS_ERROR_NULL_POINTER;  nsresult result;  nsCOMPtr<nsISupports> isupports = do_QueryInterface(aNewListener , &result);  if (NS_SUCCEEDED(result))    result = mSelectionListeners->AppendElement(isupports) ? NS_OK : NS_ERROR_FAILURE;		// addrefs  return result;}