From 799e7c3b2b1b7f25051e18143d6f8f6dd2bc76d5 Mon Sep 17 00:00:00 2001 From: "martijn.martijn%gmail.com" Date: Fri, 1 Sep 2006 09:32:57 +0000 Subject: [PATCH] Bug 287707 - After page had designmode on, there are still several issues, r=daniel, sr=peterv git-svn-id: svn://10.0.0.236/trunk@208981 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShellEditorData.cpp | 5 ++++- mozilla/editor/libeditor/html/nsHTMLEditor.cpp | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mozilla/docshell/base/nsDocShellEditorData.cpp b/mozilla/docshell/base/nsDocShellEditorData.cpp index 2480a2d8170..c78a725c167 100644 --- a/mozilla/docshell/base/nsDocShellEditorData.cpp +++ b/mozilla/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/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index e58de752c3e..7d63a47236b 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/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) {