Bug 660584 - nsILanguageAtomService.LookupLanguage should use nsACString instead of nsAString. r=smontagu
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 31 May 2011 14:09:05 +0900
changeset 70357 49297a8fbf271733833241a7678987df39419d14
parent 70356 eee0bb5dca28363af6dac0f49e965a5be3e602e5
child 70358 a18b9861a8685bf9cdf37b81ce6f1d92cc7635c9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmontagu
bugs660584
milestone7.0a1
Bug 660584 - nsILanguageAtomService.LookupLanguage should use nsACString instead of nsAString. r=smontagu
gfx/thebes/gfxFontconfigUtils.cpp
intl/locale/public/nsILanguageAtomService.h
intl/locale/src/nsLanguageAtomService.cpp
intl/locale/src/nsLanguageAtomService.h
--- a/gfx/thebes/gfxFontconfigUtils.cpp
+++ b/gfx/thebes/gfxFontconfigUtils.cpp
@@ -390,17 +390,17 @@ TryLangForGroup(const nsACString& aOSLan
                 break;
             default:
                 aFcLang->Append(*pos);
         }
         ++pos;
     }
 
     nsIAtom *atom =
-        gLangService->LookupLanguage(NS_ConvertUTF8toUTF16(*aFcLang));
+        gLangService->LookupLanguage(*aFcLang);
 
     return atom == aLangGroup;
 }
 
 /* static */ void
 gfxFontconfigUtils::GetSampleLangForGroup(nsIAtom *aLangGroup,
                                           nsACString *aFcLang)
 {
--- a/intl/locale/public/nsILanguageAtomService.h
+++ b/intl/locale/public/nsILanguageAtomService.h
@@ -47,28 +47,28 @@
  * to language groups, and access to the system locale language.
  */
 
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 #include "nsIAtom.h"
 
 #define NS_ILANGUAGEATOMSERVICE_IID \
-  {0xE8ABCA7C, 0x3909, 0x4DBC, \
-    { 0x9D, 0x03, 0xD3, 0xB5, 0xBE, 0xE4, 0xFD, 0x3F }}
+  {0xAF4C48CF, 0x8F76, 0x4477, \
+    { 0xA7, 0x0E, 0xAB, 0x09, 0x74, 0xE2, 0x41, 0xF0 }}
 
 #define NS_LANGUAGEATOMSERVICE_CONTRACTID \
   "@mozilla.org/intl/nslanguageatomservice;1"
 
 class nsILanguageAtomService : public nsISupports
 {
  public: 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILANGUAGEATOMSERVICE_IID)
 
-  virtual nsIAtom* LookupLanguage(const nsAString &aLanguage,
+  virtual nsIAtom* LookupLanguage(const nsACString &aLanguage,
                                   nsresult *aError = nsnull) = 0;
   virtual already_AddRefed<nsIAtom>
   LookupCharSet(const char *aCharSet, nsresult *aError = nsnull) = 0;
 
   virtual nsIAtom* GetLocaleLanguage(nsresult *aError = nsnull) = 0;
 
   virtual nsIAtom* GetLanguageGroup(nsIAtom *aLanguage,
                                     nsresult *aError = nsnull) = 0;
--- a/intl/locale/src/nsLanguageAtomService.cpp
+++ b/intl/locale/src/nsLanguageAtomService.cpp
@@ -63,20 +63,20 @@ nsLanguageAtomService::InitLangGroupTabl
   if (!bundleService)
     return NS_ERROR_FAILURE;
 
   return bundleService->CreateBundle("resource://gre/res/langGroups.properties",
                                      getter_AddRefs(mLangGroups));
 }
 
 nsIAtom*
-nsLanguageAtomService::LookupLanguage(const nsAString &aLanguage,
+nsLanguageAtomService::LookupLanguage(const nsACString &aLanguage,
                                       nsresult *aError)
 {
-  nsAutoString lowered(aLanguage);
+  nsCAutoString lowered(aLanguage);
   ToLowerCase(lowered);
 
   nsCOMPtr<nsIAtom> lang = do_GetAtom(lowered);
   return GetLanguageGroup(lang, aError);
 }
 
 already_AddRefed<nsIAtom>
 nsLanguageAtomService::LookupCharSet(const char *aCharSet, nsresult *aError)
--- a/intl/locale/src/nsLanguageAtomService.h
+++ b/intl/locale/src/nsLanguageAtomService.h
@@ -48,17 +48,17 @@
 
 class nsLanguageAtomService : public nsILanguageAtomService
 {
 public:
   NS_DECL_ISUPPORTS
 
   // nsILanguageAtomService
   virtual NS_HIDDEN_(nsIAtom*)
-    LookupLanguage(const nsAString &aLanguage, nsresult *aError);
+    LookupLanguage(const nsACString &aLanguage, nsresult *aError);
 
   virtual NS_HIDDEN_(already_AddRefed<nsIAtom>)
     LookupCharSet(const char *aCharSet, nsresult *aError);
 
   virtual NS_HIDDEN_(nsIAtom*) GetLocaleLanguage(nsresult *aError);
 
   virtual NS_HIDDEN_(nsIAtom*) GetLanguageGroup(nsIAtom *aLanguage,
                                                 nsresult *aError);