static needsInit=PR_TRUE;
static PRBool needsInit=PR_TRUE;
nsresult NS_InitEditorMode(nsIDOMDocument *aDOMDocument, nsIPresShell* aPresShell){  nsresult result = NS_OK;  static needsInit=PR_TRUE;  // This is a big leak if called > once, but its only temp test code, correct?  if (gEditor)    gEditor=nsnull;  NS_ASSERTION(nsnull!=aDOMDocument, "null document");  NS_ASSERTION(nsnull!=aPresShell, "null presentation shell");  if ((nsnull==aDOMDocument) || (nsnull==aPresShell))    return NS_ERROR_NULL_POINTER;/*  nsISupports *isup = nsnull;  result = nsServiceManager::GetService(kTextEditorCID,                                        kITextEditorIID, &isup);*/  result = nsComponentManager::CreateInstance(kHTMLEditorCID,                                        nsnull,                                        kIHTMLEditorIID, (void **)&gEditor);  if (NS_FAILED(result))    return result;  if (!gEditor) {    return NS_ERROR_OUT_OF_MEMORY;  }  result = gEditor->Init(aDOMDocument, aPresShell);  return result;}