res = GetBodyElement(getter_AddRefs(bodyElement));
res = GetRootElement(getter_AddRefs(bodyElement));
NS_IMETHODIMP nsHTMLEditor::SetBodyWrapWidth(PRInt32 aWrapColumn){  nsresult res;  // Ought to set a style sheet here ...  // Probably should keep around an mPlaintextStyleSheet for this purpose.  nsCOMPtr<nsIDOMElement> bodyElement;  res = GetBodyElement(getter_AddRefs(bodyElement));  if (NS_FAILED(res)) return res;  if (!bodyElement) return NS_ERROR_NULL_POINTER;  // Get the current style for this body element:  nsAutoString styleName ("style");  nsAutoString styleValue;  res = bodyElement->GetAttribute(styleName, styleValue);  if (NS_FAILED(res)) return res;  // We'll replace styles for these values:  CutStyle("white-space", styleValue);  CutStyle("width", styleValue);  CutStyle("font-family", styleValue);  // If we have other style left, trim off any existing semicolons  // or whitespace, then add a known semicolon-space:  if (styleValue.Length() > 0)  {    styleValue.Trim("; \t", PR_FALSE, PR_TRUE);    styleValue.Append("; ");  }  // Make sure we have fixed-width font.  This should be done for us,  // but it isn't, see bug 22502:, so we have to add "font: monospace;".  styleValue.Append("font-family: monospace; ");  // and now we're ready to set the new whitespace/wrapping style.  if (aWrapColumn > 0)        // Wrap to a fixed column  {    styleValue.Append("white-space: -moz-pre-wrap; width: ");    styleValue.Append(aWrapColumn);    styleValue.Append("ch;");  }  else if (aWrapColumn == 0)    styleValue.Append("white-space: -moz-pre-wrap;");  else    styleValue.Append("white-space: pre;");  res = bodyElement->SetAttribute(styleName, styleValue);#ifdef DEBUG_akkana  char* curstyle = styleValue.ToNewCString();  printf("Setting style: [%s]\nNow body looks like:\n", curstyle);  Recycle(curstyle);  //nsCOMPtr<nsIContent> nodec (do_QueryInterface(bodyElement));  //if (nodec) nodec->List(stdout);  //printf("-----\n");#endif /* DEBUG_akkana */  return res;}