summaryrefslogtreecommitdiff
path: root/intl
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-05-06 09:24:03 +0000
committerMoonchild <moonchild@palemoon.org>2021-05-06 09:24:03 +0000
commit6f707bde95dab6998ac204f9ee6c925ee230c740 (patch)
tree859f6cf99f2e026b76dcc40b27b211154310d16e /intl
parentaa0fd3d68c856504646e1d7eb499bc890ef44101 (diff)
downloaduxp-6f707bde95dab6998ac204f9ee6c925ee230c740.tar.gz
Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.
This also removes some PP abuse and takes file entries out of PP when no longer needed without XP_MACOSX conditionals.
Diffstat (limited to 'intl')
-rw-r--r--intl/locale/nsIDateTimeFormat.cpp7
-rw-r--r--intl/locale/nsLocaleConstructors.h11
-rw-r--r--intl/locale/nsLocaleService.cpp37
3 files changed, 5 insertions, 50 deletions
diff --git a/intl/locale/nsIDateTimeFormat.cpp b/intl/locale/nsIDateTimeFormat.cpp
index 263b3abb4e..1290fdc3ee 100644
--- a/intl/locale/nsIDateTimeFormat.cpp
+++ b/intl/locale/nsIDateTimeFormat.cpp
@@ -6,9 +6,7 @@
#include "nsIDateTimeFormat.h"
#include "mozilla/RefPtr.h"
-#if defined(XP_MACOSX)
-#define USE_MAC_LOCALE
-#elif defined(XP_UNIX)
+#if defined(XP_UNIX)
#define USE_UNIX_LOCALE
#endif
@@ -18,9 +16,6 @@
#ifdef USE_UNIX_LOCALE
#include "unix/nsDateTimeFormatUnix.h"
#endif
-#ifdef USE_MAC_LOCALE
-#include "mac/nsDateTimeFormatMac.h"
-#endif
using mozilla::MakeAndAddRef;
diff --git a/intl/locale/nsLocaleConstructors.h b/intl/locale/nsLocaleConstructors.h
index 2d2e579740..212f70ea53 100644
--- a/intl/locale/nsLocaleConstructors.h
+++ b/intl/locale/nsLocaleConstructors.h
@@ -15,11 +15,7 @@
#include "nsLanguageAtomService.h"
#include "nsPlatformCharset.h"
-#if defined(XP_MACOSX)
-#define USE_MAC_LOCALE
-#endif
-
-#if defined(XP_UNIX) && !defined(XP_MACOSX)
+#if defined(XP_UNIX)
#define USE_UNIX_LOCALE
#endif
@@ -28,11 +24,6 @@
#include "windows/nsDateTimeFormatWin.h"
#endif
-#ifdef USE_MAC_LOCALE
-#include "mac/nsCollationMacUC.h"
-#include "mac/nsDateTimeFormatMac.h"
-#endif
-
#ifdef USE_UNIX_LOCALE
#include "unix/nsCollationUnix.h"
#include "unix/nsDateTimeFormatUnix.h"
diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
index d81fb50c2e..5984d12274 100644
--- a/intl/locale/nsLocaleService.cpp
+++ b/intl/locale/nsLocaleService.cpp
@@ -17,8 +17,6 @@
#if defined(XP_WIN)
# include "nsWin32Locale.h"
-#elif defined(XP_MACOSX)
-# include <Carbon/Carbon.h>
#elif defined(XP_UNIX)
# include <locale.h>
# include <stdlib.h>
@@ -41,7 +39,7 @@ const char* LocaleList[LocaleListLength] =
#define NSILOCALE_MAX_ACCEPT_LANGUAGE 16
#define NSILOCALE_MAX_ACCEPT_LENGTH 18
-#if (defined(XP_UNIX) && !defined(XP_MACOSX))
+#if defined(XP_UNIX)
static int posix_locale_category[LocaleListLength] =
{
LC_COLLATE,
@@ -113,7 +111,7 @@ nsLocaleService::nsLocaleService(void)
rv = NewLocale(xpLocale, getter_AddRefs(mApplicationLocale));
NS_ENSURE_SUCCESS_VOID(rv);
#endif
-#if defined(XP_UNIX) && !defined(XP_MACOSX)
+#if defined(XP_UNIX)
RefPtr<nsLocale> resultLocale(new nsLocale());
NS_ENSURE_TRUE_VOID(resultLocale);
@@ -154,36 +152,7 @@ nsLocaleService::nsLocaleService(void)
}
mSystemLocale = do_QueryInterface(resultLocale);
mApplicationLocale = do_QueryInterface(resultLocale);
-
#endif // XP_UNIX
-
-#ifdef XP_MACOSX
- // Get string representation of user's current locale
- CFLocaleRef userLocaleRef = ::CFLocaleCopyCurrent();
- CFStringRef userLocaleStr = ::CFLocaleGetIdentifier(userLocaleRef);
- ::CFRetain(userLocaleStr);
-
- AutoTArray<UniChar, 32> buffer;
- int size = ::CFStringGetLength(userLocaleStr);
- buffer.SetLength(size + 1);
- CFRange range = ::CFRangeMake(0, size);
- ::CFStringGetCharacters(userLocaleStr, range, buffer.Elements());
- buffer[size] = 0;
-
- // Convert the locale string to the format that Mozilla expects
- nsAutoString xpLocale(reinterpret_cast<char16_t*>(buffer.Elements()));
- xpLocale.ReplaceChar('_', '-');
-
- nsresult rv = NewLocale(xpLocale, getter_AddRefs(mSystemLocale));
- if (NS_SUCCEEDED(rv)) {
- mApplicationLocale = mSystemLocale;
- }
-
- ::CFRelease(userLocaleStr);
- ::CFRelease(userLocaleRef);
-
- NS_ASSERTION(mApplicationLocale, "Failed to create locale objects");
-#endif // XP_MACOSX
}
nsLocaleService::~nsLocaleService(void)
@@ -206,7 +175,7 @@ nsLocaleService::NewLocale(const nsAString &aLocale, nsILocale **_retval)
NS_ConvertASCIItoUTF16 category(LocaleList[i]);
result = resultLocale->AddCategory(category, aLocale);
if (NS_FAILED(result)) return result;
-#if defined(XP_UNIX) && !defined(XP_MACOSX)
+#if defined(XP_UNIX)
category.AppendLiteral("##PLATFORM");
result = resultLocale->AddCategory(category, aLocale);
if (NS_FAILED(result)) return result;