PRUint32 cnt; nsresult rv = mRangeArray->Count(&cnt); if (NS_FAILED(rv)) return rv;
PRInt32 cnt = mRangeArray.Count();
nsTypedSelection::Clear(nsIPresContext* aPresContext){  setAnchorFocusRange(-1);  if (!mRangeArray)    return NS_ERROR_FAILURE;  // Get an iterator  while (PR_TRUE)  {    PRUint32 cnt;    nsresult rv = mRangeArray->Count(&cnt);    if (NS_FAILED(rv)) return rv;    if (cnt == 0)      break;    nsCOMPtr<nsISupports> isupportsindex = dont_AddRef(mRangeArray->ElementAt(0));    nsCOMPtr<nsIDOMRange> range = do_QueryInterface(isupportsindex);    mRangeArray->RemoveElementAt(0);    selectFrames(aPresContext, range, 0);    // Does RemoveElementAt also delete the elements?  }  // Reset direction so for more dependable table selection range handling  SetDirection(eDirNext);  return NS_OK;}