diff --git a/layout/xul/base/public/nsIEditorBoxObject.idl b/layout/xul/base/public/nsIEditorBoxObject.idl index 76f1ed73fff..badaa6b0b57 100644 --- a/layout/xul/base/public/nsIEditorBoxObject.idl +++ b/layout/xul/base/public/nsIEditorBoxObject.idl @@ -38,12 +38,15 @@ #include "nsIBoxObject.idl" -interface nsIEditorShell; +interface nsIEditor; interface nsIDocShell; +interface nsIEditorShell; [scriptable, uuid(14B3B669-3414-4548-AA03-EDF257D889C8)] interface nsIEditorBoxObject : nsISupports { + readonly attribute nsIEditor editor; + // nsIEditorShell is deprecated and will go away -- please don't use it! readonly attribute nsIEditorShell editorShell; readonly attribute nsIDocShell docShell; }; diff --git a/layout/xul/base/src/nsEditorBoxObject.cpp b/layout/xul/base/src/nsEditorBoxObject.cpp index 03f6b287a29..ff597efeb25 100644 --- a/layout/xul/base/src/nsEditorBoxObject.cpp +++ b/layout/xul/base/src/nsEditorBoxObject.cpp @@ -72,7 +72,7 @@ nsEditorBoxObject::SetDocument(nsIDocument* aDocument) if (mEditorShell) { rv = mEditorShell->Shutdown(); - NS_ASSERTION(NS_SUCCEEDED(rv), "Error from editorShell->Shutdown"); + NS_ASSERTION(NS_SUCCEEDED(rv), "Error from editor->Shutdown"); } // this should only be called with a null document, which indicates @@ -100,13 +100,22 @@ NS_IMETHODIMP nsEditorBoxObject::Init(nsIContent* aContent, nsIPresShell* aPresS if (NS_FAILED(rv)) return rv; NS_ASSERTION(!mEditorShell, "Double init of nsEditorBoxObject"); - + + // When editorshell goes away, this is what we should be doing: + //mEditor = do_CreateInstance("@mozilla.org/editor/htmleditor;1"); + // but we need an editorshell for the transitional period, so: mEditorShell = do_CreateInstance("@mozilla.org/editor/editorshell;1"); if (!mEditorShell) return NS_ERROR_OUT_OF_MEMORY; return NS_OK; } +NS_IMETHODIMP nsEditorBoxObject::GetEditor(nsIEditor** aResult) +{ + NS_ASSERTION(mEditorShell, "Editor box object not initted"); + return mEditorShell->GetEditor(aResult); +} + NS_IMETHODIMP nsEditorBoxObject::GetEditorShell(nsIEditorShell** aResult) { NS_ASSERTION(mEditorShell, "Editor box object not initted");