nsCOMPtr<nsISupports> nsisup(dont_AddRef(mRangeArray->ElementAt(0))); nsCOMPtr<nsIDOMRange> range; nsresult rv; range = do_QueryInterface(nsisup,&rv); if (NS_FAILED(rv)) { return rv; }  return (range->GetCollapsed(aIsCollapsed));
return mRangeArray[0]->GetCollapsed(aIsCollapsed);
nsTypedSelection::GetIsCollapsed(PRBool* aIsCollapsed){	if (!aIsCollapsed)		return NS_ERROR_NULL_POINTER;		  PRUint32 cnt = 0;  if (mRangeArray) {    nsresult rv = mRangeArray->Count(&cnt);    if (NS_FAILED(rv)) return rv;  }  if (!mRangeArray || (cnt == 0))  {    *aIsCollapsed = PR_TRUE;    return NS_OK;  }    if (cnt != 1)  {    *aIsCollapsed = PR_FALSE;    return NS_OK;  }    nsCOMPtr<nsISupports> nsisup(dont_AddRef(mRangeArray->ElementAt(0)));  nsCOMPtr<nsIDOMRange> range;  nsresult rv;  range = do_QueryInterface(nsisup,&rv);  if (NS_FAILED(rv))  {    return rv;  }                               return (range->GetCollapsed(aIsCollapsed));}