From e6f858edf7457a61e767ec31b0344fc09c0e6f18 Mon Sep 17 00:00:00 2001 From: "peterv@propagandism.org" Date: Wed, 18 Jul 2007 02:46:41 -0700 Subject: [PATCH] Fix for bug 388183 (Reloading this testcase causes crash [@ nsHTMLDocument::ChangeContentEditableCount] with null editor), now with correct whitespace. r/sr=jst. --- content/html/document/src/nsHTMLDocument.cpp | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index f8c967380d55..158c850e92ae 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -3764,25 +3764,25 @@ nsHTMLDocument::ChangeContentEditableCount(nsIContent *aElement, nsCOMPtr editor; editorDocShell->GetEditor(getter_AddRefs(editor)); if (editor) { - nsCOMPtr range; - rv = NS_NewRange(getter_AddRefs(range)); - NS_ENSURE_SUCCESS(rv, rv); - - rv = range->SelectNode(node); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr spellChecker; - rv = editor->GetInlineSpellChecker(PR_FALSE, - getter_AddRefs(spellChecker)); - NS_ENSURE_SUCCESS(rv, rv); - - if (spellChecker) { - rv = spellChecker->SpellCheckRange(range); + nsCOMPtr range; + rv = NS_NewRange(getter_AddRefs(range)); NS_ENSURE_SUCCESS(rv, rv); + + rv = range->SelectNode(node); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr spellChecker; + rv = editor->GetInlineSpellChecker(PR_FALSE, + getter_AddRefs(spellChecker)); + NS_ENSURE_SUCCESS(rv, rv); + + if (spellChecker) { + rv = spellChecker->SpellCheckRange(range); + NS_ENSURE_SUCCESS(rv, rv); + } } } } - } return NS_OK; } @@ -3832,9 +3832,9 @@ nsHTMLDocument::TurnEditingOff() editorDocShell->GetEditor(getter_AddRefs(editor)); nsCOMPtr editorss = do_QueryInterface(editor); if (editorss) { - editorss->RemoveOverrideStyleSheet(NS_LITERAL_STRING("resource:/res/contenteditable.css")); + editorss->RemoveOverrideStyleSheet(NS_LITERAL_STRING("resource:/res/contenteditable.css")); if (mEditingState == eDesignMode) - editorss->RemoveOverrideStyleSheet(NS_LITERAL_STRING("resource:/res/designmode.css")); + editorss->RemoveOverrideStyleSheet(NS_LITERAL_STRING("resource:/res/designmode.css")); } if (mEditingState == eDesignMode) {