res = mInner.GetText(textFrag, numFragments);
nsGenericDOMDataNode* inner = (nsGenericDOMDataNode*)&mInner; res = inner->GetText(textFrag, numFragments);
nsCommentNode::ConvertContentToXIF(nsXIFConverter& aConverter) const{  const nsIContent* content = this;  nsIDOMSelection* sel = aConverter.GetSelection();  nsIDocument* document;  nsresult res;  res = GetDocument(document);  if (!NS_SUCCEEDED(res))    return res;  nsTextFragment* textFrag;  PRInt32 numFragments;  res = mInner.GetText(textFrag, numFragments);  if (!NS_SUCCEEDED(res))    return res;#ifdef DEBUG_akkana  if (numFragments == 0)    printf("numFragments is zero!  Go figure!\n");#endif  if (sel != nsnull && document->IsInSelection(sel,content))  {    nsIEnumerator *enumerator;    if (NS_SUCCEEDED(sel->QueryInterface(kIEnumeratorIID, (void **)&enumerator))) {      for (enumerator->First();NS_OK != enumerator->IsDone(); enumerator->Next()) {        nsIDOMRange* range = nsnull;        if (NS_SUCCEEDED(enumerator->CurrentItem((nsISupports**)&range))) {                nsCOMPtr<nsIDOMNode> startNode;          nsCOMPtr<nsIDOMNode> endNode;          PRInt32 startOffset = 0;          PRInt32 endOffset = 0;          range->GetStartParent(getter_AddRefs(startNode));          range->GetEndParent(getter_AddRefs(endNode));          range->GetStartOffset(&startOffset);          range->GetEndOffset(&endOffset);          nsCOMPtr<nsIContent> startContent;          nsCOMPtr<nsIContent> endContent;          startContent = do_QueryInterface(startNode);          endContent = do_QueryInterface(endNode);          nsString  buffer;          textFrag->AppendTo(buffer);          if (startContent.get() == content || endContent.get() == content)          {             // NOTE: ORDER MATTERS!            // This must go before the Cut            if (endContent.get() == content)              buffer.Truncate(endOffset);                              // This must go after the Trunctate            if (startContent.get() == content)             buffer.Cut(0,startOffset);           }          aConverter.AddComment(buffer);        }      }    }  }  else    {    nsString  buffer;    textFrag->AppendTo(buffer);    aConverter.AddComment(buffer);  }  NS_IF_RELEASE(document);  // XXX Possible mem leak: Do we need to delete textFrag?  return NS_OK;}