inst = (nsISupports*)new nsXIFFormatConverter();
inst = (nsISupports*)new nsHTMLFormatConverter();
nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,                                           const nsIID &aIID,                                           void **aResult)  {      if (aResult == NULL)     {          return NS_ERROR_NULL_POINTER;      }      *aResult = NULL;      if (nsnull != aOuter)    {        return NS_ERROR_NO_AGGREGATION;    }      nsISupports *inst = nsnull;    if (mClassID.Equals(kCWindow))     {        inst = (nsISupports *)new nsWindow();    }    else if (mClassID.Equals(kCChild))     {        inst = (nsISupports *)new ChildWindow();    }    else if (mClassID.Equals(kCButton))     {        inst = (nsISupports*)(nsWidget *)new nsButton();    }    else if (mClassID.Equals(kCCheckButton))     {        inst = (nsISupports*)(nsWidget *)new nsCheckButton();    }    else if (mClassID.Equals(kCCombobox))     {        inst = (nsISupports*)(nsWidget *)new nsComboBox();    }    else if (mClassID.Equals(kCRadioButton))     {        inst = (nsISupports*)(nsWidget *)new nsRadioButton();    }    else if (mClassID.Equals(kCFileOpen))     {        inst = (nsISupports*)new nsFileWidget();    }    else if (mClassID.Equals(kCListbox))     {        inst = (nsISupports*)(nsWidget *)new nsListBox();    }    else if (mClassID.Equals(kCHorzScrollbar))     {        inst = (nsISupports*)(nsWidget *)new nsScrollbar(PR_FALSE);    }    else if (mClassID.Equals(kCVertScrollbar))     {        inst = (nsISupports*)(nsWidget *)new nsScrollbar(PR_TRUE);    }    else if (mClassID.Equals(kCTextArea))     {        inst = (nsISupports*)(nsWidget *)new nsTextAreaWidget();    }    else if (mClassID.Equals(kCTextField))     {        inst = (nsISupports*)(nsWidget *)new nsTextWidget();    }    else if (mClassID.Equals(kCAppShell))     {        inst = (nsISupports*)new nsAppShell();    }    else if (mClassID.Equals(kCToolkit))     {        inst = (nsISupports*)(nsWidget *)new nsToolkit();    }    else if (mClassID.Equals(kCLookAndFeel))     {        inst = (nsISupports*)(nsWidget *)new nsLookAndFeel();    }    else if (mClassID.Equals(kCLabel))    {        inst = (nsISupports*)(nsWidget *)new nsLabel();    }    else if (mClassID.Equals(kCTransferable))     {        inst = (nsISupports*)new nsTransferable();    }    else if (mClassID.Equals(kCClipboard)) {        inst = (nsISupports*)new nsClipboard();    }    else if (mClassID.Equals(kCXIFFormatConverter))     {        inst = (nsISupports*)new nsXIFFormatConverter();    }#if 0    else if (mClassID.Equals(kCFontRetrieverService))     {        inst = (nsISupports*)(nsIFontRetrieverService *) new nsFontRetrieverService();    }#endif#if 0    else if (mClassID.Equals(kCDragService))     {        inst = (nsISupports*)new nsDragService();    }#endif    else     {        printf("nsWidgetFactory::CreateInstance(), unhandled class.\n");    }      if (inst == NULL)     {        return NS_ERROR_OUT_OF_MEMORY;      }      nsresult res = inst->QueryInterface(aIID, aResult);    if (res != NS_OK)     {        // We didn't get the right interface, so clean up          delete inst;      }    return res;}  