nsCOMPtr<nsISupports> indexIsupports = dont_AddRef(mRangeArray->ElementAt(indx)); mAnchorFocusRange = do_QueryInterface(indexIsupports);
mAnchorFocusRange = mRangeArray[indx];
void nsTypedSelection::setAnchorFocusRange(PRInt32 indx){  PRUint32 cnt;  nsresult rv = mRangeArray->Count(&cnt);  if (NS_FAILED(rv)) return;    // XXX error?  if (((PRUint32)indx) >= cnt )    return;  if (indx < 0) //release all  {    mAnchorFocusRange = nsnull;  }  else{    nsCOMPtr<nsISupports> indexIsupports = dont_AddRef(mRangeArray->ElementAt(indx));    mAnchorFocusRange = do_QueryInterface(indexIsupports);  }}