diff --git a/icu4c/source/i18n/casetrn.cpp b/icu4c/source/i18n/casetrn.cpp index 39469edb3b1..c7304a93e62 100644 --- a/icu4c/source/i18n/casetrn.cpp +++ b/icu4c/source/i18n/casetrn.cpp @@ -84,15 +84,13 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CaseMapTransliterator) /** * Constructs a transliterator. */ -CaseMapTransliterator::CaseMapTransliterator(const Locale &loc, const UnicodeString &id, UCaseMapFull *map) : +CaseMapTransliterator::CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map) : Transliterator(id, 0), - fLoc(loc), fLocName(NULL), fCsp(NULL), fMap(map) { UErrorCode errorCode = U_ZERO_ERROR; fCsp = ucase_getSingleton(&errorCode); // expect to get NULL if failure - fLocName=fLoc.getName(); // TODO test incremental mode with context-sensitive text (e.g. greek sigma) // TODO need to call setMaximumContextLength()?! @@ -109,9 +107,8 @@ CaseMapTransliterator::~CaseMapTransliterator() { */ CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) : Transliterator(o), - fLoc(o.fLoc), fLocName(NULL), fCsp(o.fCsp), fMap(o.fMap) + fCsp(o.fCsp), fMap(o.fMap) { - fLocName=fLoc.getName(); } /** @@ -119,8 +116,6 @@ CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) : */ CaseMapTransliterator& CaseMapTransliterator::operator=(const CaseMapTransliterator& o) { Transliterator::operator=(o); - fLoc = o.fLoc; - fLocName = fLoc.getName(); fCsp = o.fCsp; fMap = o.fMap; return *this; @@ -160,7 +155,7 @@ void CaseMapTransliterator::handleTransliterate(Replaceable& text, c=text.char32At(textPos); csc.cpLimit=textPos+=U16_LENGTH(c); - result=fMap(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, fLocName, &locCache); + result=fMap(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache); if(csc.b1 && isIncremental) { // fMap() tried to look beyond the context limit diff --git a/icu4c/source/i18n/casetrn.h b/icu4c/source/i18n/casetrn.h index cf3e0f9598b..ba63e7c1831 100644 --- a/icu4c/source/i18n/casetrn.h +++ b/icu4c/source/i18n/casetrn.h @@ -24,7 +24,6 @@ #if !UCONFIG_NO_TRANSLITERATION #include "unicode/translit.h" -#include "unicode/locid.h" #include "ucase.h" U_CDECL_BEGIN @@ -51,7 +50,7 @@ public: * @param id the transliterator ID. * @param map the full case mapping function (see ucase.h) */ - CaseMapTransliterator(const Locale &loc, const UnicodeString &id, UCaseMapFull *map); + CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map); /** * Destructor. @@ -98,8 +97,6 @@ protected: UTransPosition& offsets, UBool isIncremental) const; - Locale fLoc; - const char *fLocName; UCaseProps *fCsp; UCaseMapFull *fMap; }; diff --git a/icu4c/source/i18n/titletrn.cpp b/icu4c/source/i18n/titletrn.cpp index dd3375b9003..9125e5d3f14 100644 --- a/icu4c/source/i18n/titletrn.cpp +++ b/icu4c/source/i18n/titletrn.cpp @@ -24,8 +24,8 @@ U_NAMESPACE_BEGIN UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TitlecaseTransliterator) -TitlecaseTransliterator::TitlecaseTransliterator(const Locale& theLoc) : - CaseMapTransliterator(theLoc, UNICODE_STRING("Any-Title", 9), NULL) +TitlecaseTransliterator::TitlecaseTransliterator() : + CaseMapTransliterator(UNICODE_STRING("Any-Title", 9), NULL) { // Need to look back 2 characters in the case of "can't" setMaximumContextLength(2); @@ -125,9 +125,9 @@ void TitlecaseTransliterator::handleTransliterate( type=ucase_getTypeOrIgnorable(fCsp, c); if(type>=0) { // not case-ignorable if(doTitle) { - result=ucase_toFullTitle(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, fLocName, &locCache); + result=ucase_toFullTitle(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache); } else { - result=ucase_toFullLower(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, fLocName, &locCache); + result=ucase_toFullLower(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache); } doTitle = (UBool)(type==0); // doTitle=isUncased diff --git a/icu4c/source/i18n/titletrn.h b/icu4c/source/i18n/titletrn.h index b8c67d6ec58..8493e54d8db 100644 --- a/icu4c/source/i18n/titletrn.h +++ b/icu4c/source/i18n/titletrn.h @@ -15,7 +15,6 @@ #if !UCONFIG_NO_TRANSLITERATION #include "unicode/translit.h" -#include "unicode/locid.h" #include "ucase.h" #include "casetrn.h" @@ -35,7 +34,7 @@ class U_I18N_API TitlecaseTransliterator : public CaseMapTransliterator { * Constructs a transliterator. * @param loc the given locale. */ - TitlecaseTransliterator(const Locale& loc = Locale::getDefault()); + TitlecaseTransliterator(); /** * Destructor. diff --git a/icu4c/source/i18n/tolowtrn.cpp b/icu4c/source/i18n/tolowtrn.cpp index 6eab680c604..267ce406d35 100644 --- a/icu4c/source/i18n/tolowtrn.cpp +++ b/icu4c/source/i18n/tolowtrn.cpp @@ -25,8 +25,8 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(LowercaseTransliterator) /** * Constructs a transliterator. */ -LowercaseTransliterator::LowercaseTransliterator(const Locale& theLoc) : - CaseMapTransliterator(theLoc, UNICODE_STRING("Any-Lower", 9), ucase_toFullLower) +LowercaseTransliterator::LowercaseTransliterator() : + CaseMapTransliterator(UNICODE_STRING("Any-Lower", 9), ucase_toFullLower) { } diff --git a/icu4c/source/i18n/tolowtrn.h b/icu4c/source/i18n/tolowtrn.h index c5bccc03116..6fd3d51ad8c 100644 --- a/icu4c/source/i18n/tolowtrn.h +++ b/icu4c/source/i18n/tolowtrn.h @@ -15,7 +15,6 @@ #if !UCONFIG_NO_TRANSLITERATION #include "unicode/translit.h" -#include "unicode/locid.h" #include "casetrn.h" U_NAMESPACE_BEGIN @@ -33,7 +32,7 @@ class U_I18N_API LowercaseTransliterator : public CaseMapTransliterator { * Constructs a transliterator. * @param loc the given locale. */ - LowercaseTransliterator(const Locale& loc = Locale::getDefault()); + LowercaseTransliterator(); /** * Destructor. diff --git a/icu4c/source/i18n/toupptrn.cpp b/icu4c/source/i18n/toupptrn.cpp index 3d099da240c..0678c36073c 100644 --- a/icu4c/source/i18n/toupptrn.cpp +++ b/icu4c/source/i18n/toupptrn.cpp @@ -25,8 +25,8 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UppercaseTransliterator) /** * Constructs a transliterator. */ -UppercaseTransliterator::UppercaseTransliterator(const Locale& theLoc) : - CaseMapTransliterator(theLoc, UNICODE_STRING("Any-Upper", 9), ucase_toFullUpper) +UppercaseTransliterator::UppercaseTransliterator() : + CaseMapTransliterator(UNICODE_STRING("Any-Upper", 9), ucase_toFullUpper) { } diff --git a/icu4c/source/i18n/toupptrn.h b/icu4c/source/i18n/toupptrn.h index d1796832cda..18a501c7480 100644 --- a/icu4c/source/i18n/toupptrn.h +++ b/icu4c/source/i18n/toupptrn.h @@ -15,7 +15,6 @@ #if !UCONFIG_NO_TRANSLITERATION #include "unicode/translit.h" -#include "unicode/locid.h" #include "casetrn.h" U_NAMESPACE_BEGIN @@ -33,7 +32,7 @@ class U_I18N_API UppercaseTransliterator : public CaseMapTransliterator { * Constructs a transliterator. * @param loc the given locale. */ - UppercaseTransliterator(const Locale& loc = Locale::getDefault()); + UppercaseTransliterator(); /** * Destructor.