Bug 637631 followup because I moved the wrong line by mistake
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Wed, 02 Mar 2011 08:28:46 +0000
changeset 7240 ba945a3fb9b33edbf50d231c96ca09d6d7c0bc97
parent 7239 e06d5096fae53a35f9ca1905d992adb7de261bce
child 7241 fabfe9e1c7aad0a6c9e7336fc40a96c3a948a28e
push idunknown
push userunknown
push dateunknown
bugs637631
Bug 637631 followup because I moved the wrong line by mistake
editor/ui/composer/content/editor.js
--- a/editor/ui/composer/content/editor.js
+++ b/editor/ui/composer/content/editor.js
@@ -414,18 +414,18 @@ var gEditorDocumentObserver =
 
           // Set focus to content window if not a mail composer
           // Race conditions prevent us from setting focus here
           //   when loading a url into blank window
           setTimeout(SetFocusOnStartup, 0);
 
           // Call EditorSetDefaultPrefsAndDoctype first so it gets the default author before initing toolbars
           editor.enableUndo(false);
-          editor.documentCharacterSet = prefCharsetString;
           EditorSetDefaultPrefsAndDoctype();
+          editor.resetModificationCount();
           editor.enableUndo(true);
 
           // We may load a text document into an html editor,
           //   so be sure editortype is set correctly
           // XXX We really should use the "real" plaintext editor for this!
           if (editor.contentsMIMEType == "text/plain")
           {
             try {
@@ -2460,17 +2460,17 @@ function EditorSetDefaultPrefsAndDoctype
     var prefCharsetString = 0;
     try
     {
       prefCharsetString = gPrefs.getComplexValue("intl.charset.default",
                                                  Components.interfaces.nsIPrefLocalizedString).data;
     }
     catch (ex) {}
     if ( prefCharsetString && prefCharsetString != 0)
-      editor.resetModificationCount();
+      editor.documentCharacterSet = prefCharsetString;
 
     var node = 0;
     var listlength = nodelist.length;
 
     // let's start by assuming we have an author in case we don't have the pref
     var authorFound = false;
     for (var i = 0; i < listlength && !authorFound; i++)
     {