if (range == 1) {
if ((range == 1) || (range == 2 && IS_HIGH_SURROGATE(aText[aStartInx]))) {
BinarySearchForPosition(nsIRenderingContext* acx,                         const PRUnichar* aText,                        PRInt32    aBaseWidth,                        PRInt32    aBaseInx,                        PRInt32    aStartInx,                         PRInt32    aEndInx,                         PRInt32    aCursorPos,                         PRInt32&   aIndex,                        PRInt32&   aTextWidth){  PRInt32 range = aEndInx - aStartInx;  if (range == 1) {    aIndex   = aStartInx + aBaseInx;    acx->GetWidth(aText, aIndex, aTextWidth);    return PR_TRUE;  }  PRInt32 inx = aStartInx + (range / 2);  PRInt32 textWidth = 0;  acx->GetWidth(aText, inx, textWidth);  PRInt32 fullWidth = aBaseWidth + textWidth;  if (fullWidth == aCursorPos) {    aTextWidth = textWidth;    aIndex = inx;    return PR_TRUE;  } else if (aCursorPos < fullWidth) {    aTextWidth = aBaseWidth;    if (BinarySearchForPosition(acx, aText, aBaseWidth, aBaseInx, aStartInx, inx, aCursorPos, aIndex, aTextWidth)) {      return PR_TRUE;    }  } else {    aTextWidth = fullWidth;    if (BinarySearchForPosition(acx, aText, aBaseWidth, aBaseInx, inx, aEndInx, aCursorPos, aIndex, aTextWidth)) {      return PR_TRUE;    }  }  return PR_FALSE;}