Bug 594513 - Should be able to localize "spellchecker.dictionary" preference; r,a=roc
authorChris Coulson <chrisccoulson@ubuntu.com>
Wed, 08 Sep 2010 17:33:07 -0400
changeset 52227 0a783c9282b0
parent 52226 bbd54981403b
child 52228 fa6808a7f8b3
push id15574
push usereakhgari@mozilla.com
push dateWed, 08 Sep 2010 21:46:02 +0000
treeherdermozilla-central@264f954e402d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs594513
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 594513 - Should be able to localize "spellchecker.dictionary" preference; r,a=roc
editor/composer/src/nsEditorSpellCheck.cpp
--- a/editor/composer/src/nsEditorSpellCheck.cpp
+++ b/editor/composer/src/nsEditorSpellCheck.cpp
@@ -54,16 +54,17 @@
 #include "nsIPrefService.h"
 #include "nsISupportsPrimitives.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIChromeRegistry.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsITextServicesFilter.h"
 #include "mozilla/Services.h"
+#include "nsIPrefLocalizedString.h"
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsEditorSpellCheck)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsEditorSpellCheck)
 
 NS_INTERFACE_MAP_BEGIN(nsEditorSpellCheck)
   NS_INTERFACE_MAP_ENTRY(nsIEditorSpellCheck)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIEditorSpellCheck)
   NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsEditorSpellCheck)
@@ -181,28 +182,28 @@ nsEditorSpellCheck::InitSpellChecker(nsI
 
   NS_ENSURE_TRUE(mSpellChecker, NS_ERROR_NULL_POINTER);
 
   rv = mSpellChecker->SetDocument(tsDoc, PR_TRUE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Tell the spellchecker what dictionary to use:
 
-  nsXPIDLString dictName;
+  nsString dictName;
 
   nsCOMPtr<nsIPrefBranch> prefBranch =
     do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
 
   if (NS_SUCCEEDED(rv) && prefBranch) {
-    nsCOMPtr<nsISupportsString> prefString;
+    nsCOMPtr<nsIPrefLocalizedString> prefString;
     rv = prefBranch->GetComplexValue("spellchecker.dictionary",
-                                     NS_GET_IID(nsISupportsString),
+                                     NS_GET_IID(nsIPrefLocalizedString),
                                      getter_AddRefs(prefString));
     if (NS_SUCCEEDED(rv) && prefString)
-      prefString->GetData(dictName);
+      prefString->ToString(getter_Copies(dictName));
   }
 
   if (dictName.IsEmpty())
   {
     // Prefs didn't give us a dictionary name, so just get the current
     // locale and use that as the default dictionary name!
 
     nsCOMPtr<nsIXULChromeRegistry> packageRegistry =