diff --git a/docshell/base/nsDocShellEditorData.cpp b/docshell/base/nsDocShellEditorData.cpp index 2480a2d81708..c78a725c1679 100644 --- a/docshell/base/nsDocShellEditorData.cpp +++ b/docshell/base/nsDocShellEditorData.cpp @@ -192,7 +192,10 @@ nsDocShellEditorData::SetEditor(nsIEditor *inEditor) mEditor = inEditor; // owning addref } - + + if (!inEditor) + mMakeEditable = PR_FALSE; + return NS_OK; } diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index e58de752c3e5..7d63a47236b1 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -183,10 +183,18 @@ nsHTMLEditor::~nsHTMLEditor() if (mResizedObject) HideResizers(); + nsCOMPtr selCon; + nsresult result = GetSelectionController(getter_AddRefs(selCon)); + if (NS_SUCCEEDED(result) && selCon) + { + selCon->SetSelectionFlags( + nsISelectionDisplay::DISPLAY_TEXT | nsISelectionDisplay::DISPLAY_IMAGES); + } + //the autopointers will clear themselves up. //but we need to also remove the listeners or we have a leak nsCOMPtrselection; - nsresult result = GetSelection(getter_AddRefs(selection)); + result = GetSelection(getter_AddRefs(selection)); // if we don't get the selection, just skip this if (NS_SUCCEEDED(result) && selection) {