CopyUnicodeTo(aString, offset, &mText[mTextLength], amount); mTextLength += amount;
mTextLength += nsLayoutUtils::CopyNewlineNormalizedUnicodeTo(aString, offset, &mText[mTextLength], amount);
nsHTMLFragmentContentSink::AddText(const nsAReadableString& aString){  PRInt32 addLen = aString.Length();  if (0 == addLen) {    return NS_OK;  }  // Create buffer when we first need it  if (0 == mTextSize) {    mText = (PRUnichar *) PR_MALLOC(sizeof(PRUnichar) * NS_ACCUMULATION_BUFFER_SIZE);    if (nsnull == mText) {      return NS_ERROR_OUT_OF_MEMORY;    }    mTextSize = NS_ACCUMULATION_BUFFER_SIZE;  }  // Copy data from string into our buffer; flush buffer when it fills up  PRInt32 offset = 0;  while (0 != addLen) {    PRInt32 amount = mTextSize - mTextLength;    if (amount > addLen) {      amount = addLen;    }    if (0 == amount) {      nsresult rv = FlushText();      if (NS_OK != rv) {        return rv;      }    }    CopyUnicodeTo(aString, offset, &mText[mTextLength], amount);    mTextLength += amount;    offset += amount;    addLen -= amount;  }  return NS_OK;}