Bug 943287 - Part 1. Rename nsCollation.cpp to nsCollationFactory.cpp. r?hsivonen
nsCollation.cpp implements nsCollationFactory and nsCollation utils classes.
To remove nsIPlatfromCharset dependency, I would like to remove nsCollaction utils class. So at first, I would like to rename it to nsCollactionFactory.cpp. (then, nsICollation implementation will be nsCollation.cpp)
MozReview-Commit-ID: FaG3vfzi9cl
--- a/intl/locale/mac/nsCollationMacUC.h
+++ b/intl/locale/mac/nsCollationMacUC.h
@@ -3,17 +3,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsCollationMacUC_h_
#define nsCollationMacUC_h_
#include "mozilla/Attributes.h"
#include "nsICollation.h"
-#include "nsCollation.h"
+#include "nsCollationFactory.h"
#include "nsString.h"
#include "unicode/ucol.h"
class nsCollationMacUC final : public nsICollation {
public:
nsCollationMacUC();
--- a/intl/locale/moz.build
+++ b/intl/locale/moz.build
@@ -27,33 +27,33 @@ XPIDL_SOURCES += [
'nsILocaleService.idl',
'nsIScriptableDateFormat.idl',
]
XPIDL_MODULE = 'locale'
EXPORTS += [
'DateTimeFormat.h',
- 'nsCollation.h',
'nsCollationCID.h',
+ 'nsCollationFactory.h',
'nsILanguageAtomService.h',
'nsIPlatformCharset.h',
'nsPosixLocale.h',
'nsUConvPropertySearch.h',
'nsWin32Locale.h',
]
EXPORTS.mozilla.intl += [
'LocaleService.h',
'OSPreferences.h',
]
UNIFIED_SOURCES += [
'LocaleService.cpp',
- 'nsCollation.cpp',
+ 'nsCollationFactory.cpp',
'nsLanguageAtomService.cpp',
'nsLocale.cpp',
'nsLocaleService.cpp',
'nsScriptableDateFormat.cpp',
'nsUConvPropertySearch.cpp',
'OSPreferences.cpp',
]
rename from intl/locale/nsCollation.cpp
rename to intl/locale/nsCollationFactory.cpp
--- a/intl/locale/nsCollation.cpp
+++ b/intl/locale/nsCollationFactory.cpp
@@ -1,14 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "nsCollation.h"
+#include "nsCollationFactory.h"
#include "nsCollationCID.h"
#include "nsUnicharUtils.h"
#include "prmem.h"
#include "nsIUnicodeEncoder.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/dom/EncodingUtils.h"
#include "mozilla/intl/LocaleService.h"
rename from intl/locale/nsCollation.h
rename to intl/locale/nsCollationFactory.h
--- a/intl/locale/nsCollation.h
+++ b/intl/locale/nsCollationFactory.h
@@ -1,35 +1,33 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef nsCollation_h__
-#define nsCollation_h__
+#ifndef nsCollationFactory_h__
+#define nsCollationFactory_h__
#include "nsICollation.h"
#include "nsCOMPtr.h"
#include "mozilla/Attributes.h"
class nsIUnicodeEncoder;
// Create a collation interface for the current app's locale.
//
class nsCollationFactory final : public nsICollationFactory {
~nsCollationFactory() {}
public:
- NS_DECL_ISUPPORTS
-
- NS_IMETHOD CreateCollation(nsICollation** instancePtr) override;
- NS_IMETHOD CreateCollationForLocale(const nsACString& locale, nsICollation** instancePtr) override;
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSICOLLATIONFACTORY
nsCollationFactory() {}
};
struct nsCollation {
public:
@@ -44,9 +42,9 @@ public:
// charset conversion util, C string buffer is allocate by PR_Malloc, caller should call PR_Free
nsresult SetCharset(const char* aCharset);
nsresult UnicodeToChar(const nsAString& aSrc, char** dst);
protected:
nsCOMPtr <nsIUnicodeEncoder> mEncoder;
};
-#endif /* nsCollation_h__ */
+#endif /* nsCollationFactory_h__ */
--- a/intl/locale/unix/nsCollationUnix.h
+++ b/intl/locale/unix/nsCollationUnix.h
@@ -4,17 +4,17 @@
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsCollationUnix_h__
#define nsCollationUnix_h__
#include "nsICollation.h"
-#include "nsCollation.h" // static library
+#include "nsCollationFactory.h" // static library
#include "plstr.h"
#include "mozilla/Attributes.h"
#include "nsString.h"
class nsCollationUnix final : public nsICollation {
--- a/intl/locale/windows/nsCollationWin.h
+++ b/intl/locale/windows/nsCollationWin.h
@@ -4,17 +4,17 @@
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsCollationWin_h__
#define nsCollationWin_h__
#include "nsICollation.h"
-#include "nsCollation.h" // static library
+#include "nsCollationFactory.h" // static library
#include "plstr.h"
class nsCollationWin final : public nsICollation {
~nsCollationWin();
protected: