if (!mSelectionListeners) return NS_ERROR_FAILURE; if (!inNewListener) return NS_ERROR_NULL_POINTER; nsresult result; nsCOMPtr<nsISupports> isupports = do_QueryInterface(inNewListener , &result); if (NS_SUCCEEDED(result)) result = mSelectionListeners->AppendElement(isupports); return result;
return mRangeList->AddSelectionListener(aNewListener);
nsRangeList::AddSelectionListener(nsIDOMSelectionListener* inNewListener){  if (!mSelectionListeners)    return NS_ERROR_FAILURE;  if (!inNewListener)    return NS_ERROR_NULL_POINTER;  nsresult result;  nsCOMPtr<nsISupports> isupports = do_QueryInterface(inNewListener , &result);  if (NS_SUCCEEDED(result))    result = mSelectionListeners->AppendElement(isupports);		// addrefs  return result;}