]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/titletrn.cpp
ICU-64260.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / titletrn.cpp
index 76c17d1bad7ce58da9a633b1a5e8a81cd9ca9d97..9b37d7fc8a79fc613128843eedc75f1e959f11e5 100644 (file)
@@ -1,6 +1,8 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 **********************************************************************
-*   Copyright (C) 2001-2007, International Business Machines
+*   Copyright (C) 2001-2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -15,6 +17,7 @@
 #include "unicode/uchar.h"
 #include "unicode/uniset.h"
 #include "unicode/ustring.h"
+#include "unicode/utf16.h"
 #include "titletrn.h"
 #include "umutex.h"
 #include "ucase.h"
@@ -94,7 +97,7 @@ void TitlecaseTransliterator::handleTransliterate(
     int32_t start;
     for (start = offsets.start - 1; start >= offsets.contextStart; start -= U16_LENGTH(c)) {
         c = text.char32At(start);
-        type=ucase_getTypeOrIgnorable(fCsp, c);
+        type=ucase_getTypeOrIgnorable(c);
         if(type>0) { // cased
             doTitle=FALSE;
             break;
@@ -115,19 +118,19 @@ void TitlecaseTransliterator::handleTransliterate(
 
     UnicodeString tmp;
     const UChar *s;
-    int32_t textPos, delta, result, locCache=0;
+    int32_t textPos, delta, result;
 
     for(textPos=offsets.start; textPos<offsets.limit;) {
         csc.cpStart=textPos;
         c=text.char32At(textPos);
         csc.cpLimit=textPos+=U16_LENGTH(c);
 
-        type=ucase_getTypeOrIgnorable(fCsp, c);
+        type=ucase_getTypeOrIgnorable(c);
         if(type>=0) { // not case-ignorable
             if(doTitle) {
-                result=ucase_toFullTitle(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache);
+                result=ucase_toFullTitle(c, utrans_rep_caseContextIterator, &csc, &s, UCASE_LOC_ROOT);
             } else {
-                result=ucase_toFullLower(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache);
+                result=ucase_toFullLower(c, utrans_rep_caseContextIterator, &csc, &s, UCASE_LOC_ROOT);
             }
             doTitle = (UBool)(type==0); // doTitle=isUncased