PRUint32 cnt; nsresult rv = mRangeArray->Count(&cnt); if (NS_SUCCEEDED(rv) && cnt > 0 )
PRInt32 cnt = mRangeArray.Count(); if (cnt > 0)
nsTypedSelection::RemoveRange(nsIDOMRange* aRange){  if (!aRange)    return NS_ERROR_INVALID_ARG;  RemoveItem(aRange);    nsCOMPtr<nsIPresContext>  presContext;  GetPresContext(getter_AddRefs(presContext));  selectFrames(presContext, aRange, PR_FALSE);          if (aRange == mAnchorFocusRange.get())  {		PRUint32 cnt;    nsresult rv = mRangeArray->Count(&cnt);    if (NS_SUCCEEDED(rv) && cnt > 0 )    {      setAnchorFocusRange(cnt -1);//reset anchor to LAST range.      ScrollIntoView();    }  }  if (!mFrameSelection)    return NS_OK;//nothing to do  return mFrameSelection->NotifySelectionListeners(GetType());}