Bug 655655 - decom nsIPosixLocale. r=smontagu
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 22 Jun 2011 16:34:27 +0900
changeset 71510 08a6784b462381eb9e06fc19e4c480e74ad5a85a
parent 71509 ff25dce5b886b8ce46a52572beaa490a9e444f67
child 71511 80a510fa4b7fd14c308c798064200f9437e987f6
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmontagu
bugs655655
milestone7.0a1
Bug 655655 - decom nsIPosixLocale. r=smontagu
intl/build/nsI18nModule.cpp
intl/locale/public/Makefile.in
intl/locale/public/nsIPosixLocale.h
intl/locale/public/nsLocaleCID.h
intl/locale/public/nsPosixLocale.h
intl/locale/src/nsLocaleConstructors.h
intl/locale/src/nsLocaleService.cpp
intl/locale/src/unix/nsCollationUnix.cpp
intl/locale/src/unix/nsDateTimeFormatUnix.cpp
intl/locale/src/unix/nsPosixLocale.cpp
intl/locale/src/unix/nsPosixLocale.h
intl/locale/src/unix/nsUNIXCharset.cpp
--- a/intl/build/nsI18nModule.cpp
+++ b/intl/build/nsI18nModule.cpp
@@ -91,17 +91,16 @@ NS_DEFINE_NAMED_CID(NS_SCRIPTABLEDATEFOR
 NS_DEFINE_NAMED_CID(NS_LANGUAGEATOMSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_CHARSETALIAS_CID);
 NS_DEFINE_NAMED_CID(NS_PLATFORMCHARSET_CID);
 #ifdef XP_WIN
 NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
 NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID);
 #endif
 #ifdef USE_UNIX_LOCALE
-NS_DEFINE_NAMED_CID(NS_POSIXLOCALE_CID);
 NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
 NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID);
 #endif
 #ifdef USE_MAC_LOCALE
 NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
 NS_DEFINE_NAMED_CID(NS_DATETIMEFORMAT_CID);
 #endif
 #ifdef XP_OS2
@@ -127,17 +126,16 @@ static const mozilla::Module::CIDEntry k
     { &kNS_LANGUAGEATOMSERVICE_CID, false, NULL, nsLanguageAtomServiceConstructor },
     { &kNS_CHARSETALIAS_CID, false, NULL, nsCharsetAlias2Constructor },
     { &kNS_PLATFORMCHARSET_CID, false, NULL, nsPlatformCharsetConstructor },
 #ifdef XP_WIN
     { &kNS_COLLATION_CID, false, NULL, nsCollationWinConstructor },
     { &kNS_DATETIMEFORMAT_CID, false, NULL, nsDateTimeFormatWinConstructor },
 #endif
 #ifdef USE_UNIX_LOCALE
-    { &kNS_POSIXLOCALE_CID, false, NULL, nsPosixLocaleConstructor },
     { &kNS_COLLATION_CID, false, NULL, nsCollationUnixConstructor },
     { &kNS_DATETIMEFORMAT_CID, false, NULL, nsDateTimeFormatUnixConstructor },
 #endif
 #ifdef USE_MAC_LOCALE
     { &kNS_COLLATION_CID, false, NULL, nsCollationMacUCConstructor },
     { &kNS_DATETIMEFORMAT_CID, false, NULL, nsDateTimeFormatMacConstructor },
 #endif
 #ifdef XP_OS2
@@ -165,17 +163,16 @@ static const mozilla::Module::ContractID
     { NS_LANGUAGEATOMSERVICE_CONTRACTID, &kNS_LANGUAGEATOMSERVICE_CID },
     { NS_CHARSETALIAS_CONTRACTID, &kNS_CHARSETALIAS_CID },
     { NS_PLATFORMCHARSET_CONTRACTID, &kNS_PLATFORMCHARSET_CID },
 #ifdef XP_WIN
     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
 #endif
 #ifdef USE_UNIX_LOCALE
-    { NS_POSIXLOCALE_CONTRACTID, &kNS_POSIXLOCALE_CID },
     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
 #endif
 #ifdef USE_MAC_LOCALE
     { NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
     { NS_DATETIMEFORMAT_CONTRACTID, &kNS_DATETIMEFORMAT_CID },
 #endif
 #ifdef XP_OS2
--- a/intl/locale/public/Makefile.in
+++ b/intl/locale/public/Makefile.in
@@ -44,17 +44,17 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE		= locale
 
 EXPORTS		= \
 		nsCollationCID.h \
 		nsDateTimeFormatCID.h \
 		nsIDateTimeFormat.h \
 		nsILanguageAtomService.h \
-		nsIPosixLocale.h \
+		nsPosixLocale.h \
 		nsIOS2Locale.h \
 		nsWin32Locale.h \
 		nsICharsetAlias.h \
 		nsIPlatformCharset.h \
 		nsLocaleCID.h \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/intl/locale/public/nsLocaleCID.h
+++ b/intl/locale/public/nsLocaleCID.h
@@ -32,37 +32,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #ifndef nsLocaleCID_h__
 #define nsLocaleCID_h__
 
-// {D92D57C3-BA1D-11d2-AF0C-0060089FE59B}
-#define NS_WIN32LOCALE_CID								\
-{	0xd92d57c3, 0xba1d, 0x11d2,							\
-{	0xaf, 0xc, 0x0, 0x60, 0x8, 0x9f, 0xe5, 0x9b } }
-
-#define NS_WIN32LOCALE_CONTRACTID "@mozilla.org/locale/win32-locale;1"
-
-// {D92D57C4-BA1D-11d2-AF0C-0060089FE59B}
-#define NS_MACLOCALE_CID								\
-{	0xd92d57c4, 0xba1d, 0x11d2,							\
-{	0xaf, 0xc, 0x0, 0x60, 0x8, 0x9f, 0xe5, 0x9b } }		
-
-#define NS_MACLOCALE_CONTRACTID "@mozilla.org/locale/mac-locale;1"
-
-// {D92D57C5-BA1D-11d2-AF0C-0060089FE59B}
-#define NS_POSIXLOCALE_CID								\
-{	0xd92d57c5, 0xba1d, 0x11d2,							\
-{	0xaf, 0xc, 0x0, 0x60, 0x8, 0x9f, 0xe5, 0x9b } }
-
-#define NS_POSIXLOCALE_CONTRACTID "@mozilla.org/locale/posix-locale;1"
-
 // {F25F74F1-FB59-11d3-A9F2-00203522A03C}
 #define NS_OS2LOCALE_CID			 \
 { 0xf25f74f1, 0xfb59, 0x11d3,                  \
 { 0xa9, 0xf2, 0x0, 0x20, 0x35, 0x22, 0xa0, 0x3c }}
 
 #define NS_OS2LOCALE_CONTRACTID "@mozilla.org/locale/os2-locale;1"
 
 #endif // nsLocaleCID_h__
rename from intl/locale/public/nsIPosixLocale.h
rename to intl/locale/public/nsPosixLocale.h
--- a/intl/locale/public/nsIPosixLocale.h
+++ b/intl/locale/public/nsPosixLocale.h
@@ -34,36 +34,24 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #ifndef nsIPosixLocale_h__
 #define nsIPosixLocale_h__
 
 
-#include "nsISupports.h"
 #include "nscore.h"
 #include "nsString.h"
 
-/* a434957c-6514-447c-991b-2117b633359c */
-#define	NS_IPOSIXLOCALE_IID	  \
-{   0xa434957c, \
-    0x6514, \
-    0x447c, \
-    {0x99, 0x1b, 0x21, 0x17, 0xb6, 0x33, 0x35, 0x9c} }
-
 #define MAX_LANGUAGE_CODE_LEN 3
 #define MAX_COUNTRY_CODE_LEN  3
 #define MAX_LOCALE_LEN        128
 #define MAX_EXTRA_LEN         65
 
-class nsIPosixLocale : public nsISupports {
+class nsPosixLocale {
 
 public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPOSIXLOCALE_IID)
-
-  NS_IMETHOD GetPlatformLocale(const nsAString& locale, nsACString& posixLocale) = 0;
-  NS_IMETHOD GetXPLocale(const char* posixLocale, nsAString& locale) = 0;
+  static nsresult GetPlatformLocale(const nsAString& locale, nsACString& posixLocale);
+  static nsresult GetXPLocale(const char* posixLocale, nsAString& locale);
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsIPosixLocale, NS_IPOSIXLOCALE_IID)
-
 #endif
--- a/intl/locale/src/nsLocaleConstructors.h
+++ b/intl/locale/src/nsLocaleConstructors.h
@@ -72,17 +72,16 @@
 #ifdef USE_MAC_LOCALE
 #include "nsCollationMacUC.h"
 #include "nsDateTimeFormatMac.h"
 #endif
 
 #ifdef USE_UNIX_LOCALE
 #include "nsCollationUnix.h"
 #include "nsDateTimeFormatUnix.h"
-#include "nsPosixLocale.h"
 #endif
 
 #define NSLOCALE_MAKE_CTOR(ctor_, iface_, func_)          \
 static nsresult                                           \
 ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) \
 {                                                         \
   *aResult = nsnull;                                      \
   if (aOuter)                                             \
@@ -105,17 +104,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsCharset
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPlatformCharset, Init)
 
 #ifdef XP_WIN
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationWin)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatWin)
 #endif
 
 #ifdef USE_UNIX_LOCALE
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsPosixLocale)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationUnix)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatUnix)
 #endif  
 
 #ifdef USE_MAC_LOCALE
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationMacUC)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDateTimeFormatMac)
 #endif  
--- a/intl/locale/src/nsLocaleService.cpp
+++ b/intl/locale/src/nsLocaleService.cpp
@@ -59,17 +59,17 @@
 #elif defined(XP_OS2)
 #  include "unidef.h"
 #  include "nsIOS2Locale.h"
 #elif defined(XP_MACOSX)
 #  include <Carbon/Carbon.h>
 #elif defined(XP_UNIX)
 #  include <locale.h>
 #  include <stdlib.h>
-#  include "nsIPosixLocale.h"
+#  include "nsPosixLocale.h"
 #endif
 
 //
 // implementation constants
 const int LocaleListLength = 6;
 const char* LocaleList[LocaleListLength] = 
 {
 	NSILOCALE_COLLATE,
@@ -152,65 +152,57 @@ nsLocaleService::nsLocaleService(void)
     //
     win_lcid = GetUserDefaultLCID();
     NS_ENSURE_TRUE(win_lcid, );
     nsWin32Locale::GetXPLocale(win_lcid, xpLocale);
     rv = NewLocale(xpLocale, getter_AddRefs(mApplicationLocale));
     NS_ENSURE_SUCCESS(rv, );
 #endif
 #if defined(XP_UNIX) && !defined(XP_MACOSX)
-    nsCOMPtr<nsIPosixLocale> posixConverter = do_GetService(NS_POSIXLOCALE_CONTRACTID);
-
-    nsAutoString xpLocale, platformLocale;
-    if (posixConverter) {
-        nsAutoString category, category_platform;
-        int i;
-
-        nsRefPtr<nsLocale> resultLocale(new nsLocale());
-        if ( resultLocale == NULL ) { 
-            return; 
-        }
-
+    nsRefPtr<nsLocale> resultLocale(new nsLocale());
+    NS_ENSURE_TRUE(resultLocale, );
 
 #ifdef MOZ_WIDGET_QT
-        const char* lang = QLocale::system().name().toAscii();
+    const char* lang = QLocale::system().name().toAscii();
 #else
-        // Get system configuration
-        const char* lang = getenv("LANG");
+    // Get system configuration
+    const char* lang = getenv("LANG");
 #endif
 
-        for( i = 0; i < LocaleListLength; i++ ) {
-            nsresult result;
-            // setlocale( , "") evaluates LC_* and LANG
-            char* lc_temp = setlocale(posix_locale_category[i], "");
-            CopyASCIItoUTF16(LocaleList[i], category);
-            category_platform = category;
-            category_platform.AppendLiteral("##PLATFORM");
-            if (lc_temp != nsnull) {
-                result = posixConverter->GetXPLocale(lc_temp, xpLocale);
-                CopyASCIItoUTF16(lc_temp, platformLocale);
+    nsAutoString xpLocale, platformLocale;
+    nsAutoString category, category_platform;
+    int i;
+
+    for( i = 0; i < LocaleListLength; i++ ) {
+        nsresult result;
+        // setlocale( , "") evaluates LC_* and LANG
+        char* lc_temp = setlocale(posix_locale_category[i], "");
+        CopyASCIItoUTF16(LocaleList[i], category);
+        category_platform = category;
+        category_platform.AppendLiteral("##PLATFORM");
+        if (lc_temp != nsnull) {
+            result = nsPosixLocale::GetXPLocale(lc_temp, xpLocale);
+            CopyASCIItoUTF16(lc_temp, platformLocale);
+        } else {
+            if ( lang == nsnull ) {
+                platformLocale.AssignLiteral("en_US");
+                result = nsPosixLocale::GetXPLocale("en-US", xpLocale);
             } else {
-                if ( lang == nsnull ) {
-                    platformLocale.AssignLiteral("en_US");
-                    result = posixConverter->GetXPLocale("en-US", xpLocale);
-                }
-                else {
-                    CopyASCIItoUTF16(lang, platformLocale);
-                    result = posixConverter->GetXPLocale(lang, xpLocale);
-                }
+                CopyASCIItoUTF16(lang, platformLocale);
+                result = nsPosixLocale::GetXPLocale(lang, xpLocale);
             }
-            if (NS_FAILED(result)) {
-                return;
-            }
-            resultLocale->AddCategory(category, xpLocale);
-            resultLocale->AddCategory(category_platform, platformLocale);
+        }
+        if (NS_FAILED(result)) {
+            return;
         }
-        mSystemLocale = do_QueryInterface(resultLocale);
-        mApplicationLocale = do_QueryInterface(resultLocale);
-    }  // if ( NS_SUCCEEDED )...
+        resultLocale->AddCategory(category, xpLocale);
+        resultLocale->AddCategory(category_platform, platformLocale);
+    }
+    mSystemLocale = do_QueryInterface(resultLocale);
+    mApplicationLocale = do_QueryInterface(resultLocale);
        
 #endif // XP_UNIX
 #ifdef XP_OS2
     nsCOMPtr<nsIOS2Locale> os2Converter = do_GetService(NS_OS2LOCALE_CONTRACTID);
     nsAutoString xpLocale;
     if (os2Converter) {
         nsAutoString category;
         int i;
--- a/intl/locale/src/unix/nsCollationUnix.cpp
+++ b/intl/locale/src/unix/nsCollationUnix.cpp
@@ -36,20 +36,19 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include  <locale.h>
 #include "prmem.h"
 #include "nsCollationUnix.h"
 #include "nsIServiceManager.h"
 #include "nsIComponentManager.h"
-#include "nsLocaleCID.h"
 #include "nsILocaleService.h"
 #include "nsIPlatformCharset.h"
-#include "nsIPosixLocale.h"
+#include "nsPosixLocale.h"
 #include "nsCOMPtr.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsIPrefLocalizedString.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 //#define DEBUG_UNIX_COLLATION
 
@@ -121,20 +120,17 @@ nsresult nsCollationUnix::Initialize(nsI
 
   // Get platform locale and charset name from locale, if available
   if (NS_SUCCEEDED(res)) {
     // keep the same behavior as 4.x as well as avoiding Linux collation key problem
     if (localeStr.LowerCaseEqualsLiteral("en_us")) { // note: locale is in platform format
       localeStr.AssignLiteral("C");
     }
 
-    nsCOMPtr <nsIPosixLocale> posixLocale = do_GetService(NS_POSIXLOCALE_CONTRACTID, &res);
-    if (NS_SUCCEEDED(res)) {
-      res = posixLocale->GetPlatformLocale(localeStr, mLocale);
-    }
+    nsPosixLocale::GetPlatformLocale(localeStr, mLocale);
 
     nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &res);
     if (NS_SUCCEEDED(res)) {
       nsCAutoString mappedCharset;
       res = platformCharset->GetDefaultCharsetForLocale(localeStr, mappedCharset);
       if (NS_SUCCEEDED(res)) {
         mCollation->SetCharset(mappedCharset.get());
       }
--- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
+++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp
@@ -36,20 +36,19 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include <locale.h>
 #include "plstr.h"
 #include "nsIServiceManager.h"
 #include "nsDateTimeFormatUnix.h"
 #include "nsIComponentManager.h"
-#include "nsLocaleCID.h"
 #include "nsILocaleService.h"
 #include "nsIPlatformCharset.h"
-#include "nsIPosixLocale.h"
+#include "nsPosixLocale.h"
 #include "nsCRT.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 
 NS_IMPL_THREADSAFE_ISUPPORTS1(nsDateTimeFormatUnix, nsIDateTimeFormat)
 
 // init this interface to a specified locale
 nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale)
@@ -98,20 +97,17 @@ nsresult nsDateTimeFormatUnix::Initializ
   else {
     res = locale->GetCategory(aCategory, localeStr);
     NS_ASSERTION(NS_SUCCEEDED(res), "failed to get locale info");
   }
 
   if (NS_SUCCEEDED(res) && !localeStr.IsEmpty()) {
     mLocale = localeStr; // cache locale name
 
-    nsCOMPtr <nsIPosixLocale> posixLocale = do_GetService(NS_POSIXLOCALE_CONTRACTID, &res);
-    if (NS_SUCCEEDED(res)) {
-      res = posixLocale->GetPlatformLocale(mLocale, mPlatformLocale);
-    }
+    nsPosixLocale::GetPlatformLocale(mLocale, mPlatformLocale);
 
     nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &res);
     if (NS_SUCCEEDED(res)) {
       nsCAutoString mappedCharset;
       res = platformCharset->GetDefaultCharsetForLocale(mLocale, mappedCharset);
       if (NS_SUCCEEDED(res)) {
         mCharset = mappedCharset;
       }
--- a/intl/locale/src/unix/nsPosixLocale.cpp
+++ b/intl/locale/src/unix/nsPosixLocale.cpp
@@ -30,38 +30,27 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "nsISupports.h"
 #include "nscore.h"
 #include "nsString.h"
 #include "nsPosixLocale.h"
-#include "nsLocaleCID.h"
 #include "prprf.h"
 #include "plstr.h"
 #include "nsReadableUtils.h"
 
-/* nsPosixLocale ISupports */
-NS_IMPL_ISUPPORTS1(nsPosixLocale, nsIPosixLocale)
-
-nsPosixLocale::nsPosixLocale(void)
-{
-}
+static PRBool
+ParseLocaleString(const char* locale_string, char* language, char* country, char* extra, char separator);
 
-nsPosixLocale::~nsPosixLocale(void)
-{
-
-}
-
-NS_IMETHODIMP 
+nsresult 
 nsPosixLocale::GetPlatformLocale(const nsAString& locale, nsACString& posixLocale)
 {
   char  country_code[MAX_COUNTRY_CODE_LEN+1];
   char  lang_code[MAX_LANGUAGE_CODE_LEN+1];
   char  extra[MAX_EXTRA_LEN+1];
   char  posix_locale[MAX_LOCALE_LEN+1];
   NS_LossyConvertUTF16toASCII xp_locale(locale);
 
@@ -91,17 +80,17 @@ nsPosixLocale::GetPlatformLocale(const n
 
     posixLocale = posix_locale;
     return NS_OK;
   }
 
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP
+nsresult
 nsPosixLocale::GetXPLocale(const char* posixLocale, nsAString& locale)
 {
   char  country_code[MAX_COUNTRY_CODE_LEN+1];
   char  lang_code[MAX_LANGUAGE_CODE_LEN+1];
   char  extra[MAX_EXTRA_LEN+1];
   char  posix_locale[MAX_LOCALE_LEN+1];
 
   if (posixLocale!=nsnull) {
@@ -135,18 +124,18 @@ nsPosixLocale::GetXPLocale(const char* p
   }
 
     return NS_ERROR_FAILURE;
 
 }
 
 //
 // returns PR_FALSE/PR_TRUE depending on if it was of the form LL-CC.Extra
-PRBool
-nsPosixLocale::ParseLocaleString(const char* locale_string, char* language, char* country, char* extra, char separator)
+static PRBool
+ParseLocaleString(const char* locale_string, char* language, char* country, char* extra, char separator)
 {
   const char *src = locale_string;
   char modifier[MAX_EXTRA_LEN+1];
   char *dest;
   int dest_space, len;
 
   *language = '\0';
   *country = '\0';
deleted file mode 100644
--- a/intl/locale/src/unix/nsPosixLocale.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-#ifndef nsPosixLocale_h__
-#define nsPosixLocale_h__
-
-
-#include "nsISupports.h"
-#include "nscore.h"
-#include "nsString.h"
-#include "nsIPosixLocale.h"
-
-
-
-class nsPosixLocale : public nsIPosixLocale {
-
-  NS_DECL_ISUPPORTS
-
-public:
-  
-  nsPosixLocale();
-  virtual ~nsPosixLocale();
-
-  NS_IMETHOD GetPlatformLocale(const nsAString& locale, nsACString& posixLocale);
-  NS_IMETHOD GetXPLocale(const char* posixLocale, nsAString& locale);
-
-protected:
-  inline PRBool ParseLocaleString(const char* locale_string, char* language, char* country, char* extra, char separator);
-
-};
-
-
-#endif
--- a/intl/locale/src/unix/nsUNIXCharset.cpp
+++ b/intl/locale/src/unix/nsUNIXCharset.cpp
@@ -36,17 +36,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include <locale.h>
 #include "nsIPlatformCharset.h"
 #include "pratom.h"
 #include "nsUConvPropertySearch.h"
 #include "nsCOMPtr.h"
 #include "nsReadableUtils.h"
-#include "nsLocaleCID.h"
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
 #include "nsIUnicodeDecoder.h"
 #include "nsIUnicodeEncoder.h"
 #include "nsICharsetConverterManager.h"
 #include "nsEncoderDecoderUtils.h"
 #if HAVE_GNU_LIBC_VERSION_H
 #include <gnu/libc-version.h>