Removed unused code in editor appcore and cleaned up factory registration

This commit is contained in:
cmanske%netscape.com 1999-03-09 00:05:27 +00:00
parent a487e4171d
commit 27cb3c57da
3 changed files with 1 additions and 69 deletions

@ -245,7 +245,6 @@ nsEditorAppCore::DoEditorMode(nsIWebShell *aWebShell)
nsIPresShell* shell = GetPresShellFor(aWebShell);
NS_InitEditorMode(mDOMDoc, shell);
mEditor = GetEditor();
//SetToEditorMode(mDOMDoc, shell);
NS_RELEASE(mDOMDoc);
NS_IF_RELEASE(shell);
}
@ -512,69 +511,3 @@ static NS_DEFINE_CID(kEditorCID, NS_EDITOR_CID);
#endif
#endif
NS_IMETHODIMP
nsEditorAppCore::SetToEditorMode(nsIDOMDocument *aDOMDocument, nsIPresShell* aPresShell)
{
nsresult result = NS_OK;
static needsInit=PR_TRUE;
#if 0
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;
/** temp code until the editor auto-registers **/
if (PR_TRUE==needsInit)
{
needsInit=PR_FALSE;
result = nsRepository::RegisterFactory(kHTMLEditorCID, EDITOR_DLL,
PR_FALSE, PR_FALSE);
if (NS_ERROR_FACTORY_EXISTS!=result)
{
if (NS_FAILED(result))
return result;
}
result = nsRepository::RegisterFactory(kTextEditorCID, EDITOR_DLL,
PR_FALSE, PR_FALSE);
if (NS_ERROR_FACTORY_EXISTS!=result)
{
if (NS_FAILED(result))
return result;
}
result = nsRepository::RegisterFactory(kEditorCID, EDITOR_DLL,
PR_FALSE, PR_FALSE);
if (NS_ERROR_FACTORY_EXISTS!=result)
{
if (NS_FAILED(result))
return result;
}
}
/** end temp code **/
/*
nsISupports *isup = nsnull;
result = nsServiceManager::GetService(kHTMLEditorCID,
kIHTMLEditorIID, &isup);
*/
result = nsRepository::CreateInstance(kHTMLEditorCID,
nsnull,
kIHTMLEditorIID, (void **)&gEditor);
if (NS_FAILED(result))
return result;
if (!gEditor) {
return NS_ERROR_OUT_OF_MEMORY;
}
gEditor->InitHTMLEditor(aDOMDocument, aPresShell);
gEditor->EnableUndo(PR_TRUE);
#endif
return result;
}

@ -78,7 +78,6 @@ class nsEditorAppCore : public nsBaseAppCore,
protected:
NS_IMETHOD SetToEditorMode(nsIDOMDocument *aDOMDocument, nsIPresShell* aPresShell);
nsIPresShell* GetPresShellFor(nsIWebShell* aWebShell);
void DoEditorMode(nsIWebShell *aWebShell);
NS_IMETHOD ExecuteScript(nsIScriptContext * aContext, const nsString& aScript);

@ -102,7 +102,7 @@ NS_SetupRegistry_1()
nsRepository::RegisterComponent(kToolbarCoreCID, NULL, NULL, APPCORES_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kBrowserAppCoreCID, NULL, NULL, APPCORES_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kEditorAppCoreCID, NULL, NULL, APPCORES_DLL, PR_FALSE, PR_FALSE);
nsRepository::RegisterComponent(kIEditFactoryIID, NULL, NULL, EDITOR_DLL, PR_FALSE, PR_FALSE);
//All Editor registration is done in webshell/tests/viewer/nsSetupregistry.cpp
//#endif
/// nsRepository::RegisterComponent(kCBrowserControllerCID, NULL, NULL, BROWSER_DLL, PR_FALSE, PR_FALSE);
}