massive change to stop the editor fromknowing about nsIPresShell or nsIDocument

git-svn-id: svn://10.0.0.236/trunk@67485 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mjudge%netscape.com
2000-04-28 06:20:36 +00:00
parent 6ed5ffdd71
commit aacbb20c68
21 changed files with 73 additions and 113 deletions

View File

@@ -602,22 +602,23 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell)
err = nsComponentManager::CreateInstance(kHTMLEditorCID, nsnull, NS_GET_IID(nsIEditor), getter_AddRefs(editor));
if(!editor)
err = NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsISelectionController> selCon = do_QueryInterface(aPresShell);
if (NS_SUCCEEDED(err))
{
if (mEditorTypeString.EqualsWithConversion("text"))
{
err = editor->Init(aDoc, aPresShell, nsIHTMLEditor::eEditorPlaintextMask);
err = editor->Init(aDoc, aPresShell, selCon, nsIHTMLEditor::eEditorPlaintextMask);
mEditorType = ePlainTextEditorType;
}
else if (mEditorTypeString.EqualsWithConversion("html") || mEditorTypeString.IsEmpty()) // empty string default to HTML editor
{
err = editor->Init(aDoc, aPresShell, 0);
err = editor->Init(aDoc, aPresShell, selCon, 0);
mEditorType = eHTMLTextEditorType;
}
else if (mEditorTypeString.EqualsWithConversion("htmlmail")) // HTML editor with special mail rules
{
err = editor->Init(aDoc, aPresShell, nsIHTMLEditor::eEditorMailMask);
err = editor->Init(aDoc, aPresShell, selCon, nsIHTMLEditor::eEditorMailMask);
mEditorType = eHTMLTextEditorType;
}
else