PRUnichar* text = paintBuf;  nsPoint		bottomLeft(0, 0); nscoord	 textWidth;  PRUint32  measureLen = ip[inOffset - mContentOffset] - mContentOffset;   inRendContext->GetWidth(text, measureLen, textWidth);  bottomLeft.x = textWidth; *outPoint = bottomLeft;
TextFrame::GetPointFromOffset(nsIPresContext* inPresContext, nsIRenderingContext* inRendContext, PRInt32 inOffset, nsPoint* outPoint){  NS_PRECONDITION(inPresContext && inRendContext && outPoint, "Null ptr");    // Make enough space to transform  PRUnichar     wordBufMem[WORD_BUF_SIZE];  PRUnichar     paintBufMem[TEXT_BUF_SIZE];  PRUnichar*    paintBuf = paintBufMem;  PRInt32       indicies[TEXT_BUF_SIZE];  PRInt32*      ip = indicies;    if (mContentLength > TEXT_BUF_SIZE)  {    ip = new PRInt32[mContentLength+1];    paintBuf = new PRUnichar[mContentLength];  }     nscoord width = mRect.width;  PRInt32 textLength;  TextStyle ts(*inPresContext, *inRendContext, mStyleContext);  nsCOMPtr<nsIPresShell> shell;  inPresContext->GetShell(getter_AddRefs(shell));  nsCOMPtr<nsIDocument> doc;  shell->GetDocument(getter_AddRefs(doc));  // Transform text from content into renderable form  nsCOMPtr<nsILineBreaker> lb;  doc->GetLineBreaker(getter_AddRefs(lb));  nsTextTransformer tx(wordBufMem, WORD_BUF_SIZE,lb);  PrepareUnicodeText(tx, ip, paintBuf, textLength, width);  PRUnichar* text = paintBuf;	nsPoint		bottomLeft(0, 0);	nscoord	 textWidth;		PRUint32  measureLen = ip[inOffset - mContentOffset] - mContentOffset;		// do I need to do special stuff with small caps etc here?	inRendContext->GetWidth(text, measureLen, textWidth);	bottomLeft.x = textWidth;  *outPoint = bottomLeft;  // Cleanup  if (paintBuf != paintBufMem)    delete [] paintBuf;  if (ip != indicies)    delete [] ip;  return NS_OK;}