Remove an explicit ICU dependency (by lars)
authorzack <zack@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Dec 2006 00:21:55 +0000 (00:21 +0000)
committerzack <zack@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Dec 2006 00:21:55 +0000 (00:21 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18110 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/xml/XPathParser.cpp

index 7276c82b14a7e3105e5f9cd331cca1ca7f49936d..dfe8751427e37fa2b1cc12595f365e345b465e1e 100644 (file)
@@ -1,3 +1,12 @@
+2006-12-09  Lars Knoll  <lars@trolltech.com>
+
+        Reviewed by Maciej.
+
+        Remove an explicit ICU dependency.
+
+        * xml/XPathParser.cpp:
+        (WebCore::XPath::charCat):
+
 2006-12-09  Zack Rusin  <zack@kde.org>
 
         Adjusting the build after the icu changes.
index 09128851479111edec1ba8722045c82b3165aa7f..829b7077e8c859101011dd359a3860b44d0e4276 100644 (file)
@@ -57,22 +57,20 @@ static XMLCat charCat(UChar aChar)
 
     if (aChar == '.' || aChar == '-')
         return NameCont;
-    switch (u_charType(aChar)) {
-        case U_LOWERCASE_LETTER: //Ll
-        case U_UPPERCASE_LETTER: //Lu
-        case U_OTHER_LETTER:     //Lo
-        case U_TITLECASE_LETTER: //Lt
-        case U_LETTER_NUMBER:    //Nl
-            return NameStart;
-        case U_COMBINING_SPACING_MARK: //Mc
-        case U_ENCLOSING_MARK:         //Me
-        case U_NON_SPACING_MARK:       //Mn
-        case U_MODIFIER_LETTER:        //Lm
-        case U_DECIMAL_DIGIT_NUMBER:   //Nd
-            return NameCont;
-        default:
-            return NotPartOfName;
-    }
+    uint category = WTF::Unicode::category(aChar);
+    if (category & (WTF::Unicode::Letter_Uppercase|
+                    WTF::Unicode::Letter_Lowercase|
+                    WTF::Unicode::Letter_Other|
+                    WTF::Unicode::Letter_Titlecase|
+                    WTF::Unicode::Number_Letter))
+        return NameStart;
+    if (category & (WTF::Unicode::Mark_NonSpacing|
+                    WTF::Unicode::Mark_SpacingCombining|
+                    WTF::Unicode::Mark_Enclosing|
+                    WTF::Unicode::Letter_Modifier|
+                    WTF::Unicode::Number_DecimalDigit))
+        return NameCont;
+    return NotPartOfName;
 }
 
 static void setUpAxisNamesMap(HashMap<String, Step::Axis>& axisNames)