[haiku-webkit-commits] r256 - in webkit/trunk/WebCore: . platform/text/haiku

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Mon, 01 Mar 2010 17:32:58 +0000

Author: stippi
Date: Mon Mar  1 17:32:57 2010
New Revision: 256
URL: http://mmlr.dyndns.org/changeset/256

Log:
Implemented getting the currnet local for text breaks and search. Since we
are already linking against ICU libs, I hope linking against liblocal doesn't
add any overhead. I can at least not perceive any additional startup delay.

Modified:
   webkit/trunk/WebCore/Jamfile
   
webkit/trunk/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp

Modified: webkit/trunk/WebCore/Jamfile
==============================================================================
--- webkit/trunk/WebCore/Jamfile        Mon Mar  1 10:15:48 2010        (r255)
+++ webkit/trunk/WebCore/Jamfile        Mon Mar  1 17:32:57 2010        (r256)
@@ -1682,7 +1682,7 @@
         webcore1.a webcore2.a
         libjavascriptcore.so
         # Other required libraries
-        curl icu-common icu-data icu-i18n jpeg png sqlite3 xml2 z stdc++
+        curl icu-common icu-data icu-i18n jpeg locale png sqlite3 xml2 z stdc++
         # Haiku libraries
         be bsd network root textencoding translation
 ;

Modified: 
webkit/trunk/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp
==============================================================================
--- 
webkit/trunk/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp  
    Mon Mar  1 10:15:48 2010        (r255)
+++ 
webkit/trunk/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp  
    Mon Mar  1 17:32:57 2010        (r256)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Stephan Aßmus <superstippi@xxxxxx>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -21,21 +21,34 @@
 #include "config.h"
 #include "TextBreakIteratorInternalICU.h"
 
-#include "NotImplemented.h"
-
+#include <Locale.h>
+#include <LocaleRoster.h>
 
 namespace WebCore {
 
+static const char* currentLocaleID()
+{
+    static BString local;
+    static bool initialized = false;
+    if (!initialized) {
+       initialized = true;
+       BLanguage* language;
+        if (be_locale_roster->GetDefaultLanguage(&language) == B_OK)
+            local = language->Code();
+        else
+            local = "en_US";
+    }
+    return local.String();
+}
+
 const char* currentSearchLocaleID()
 {
-    notImplemented();
-    return "";
+    return currentLocaleID();
 }
 
 const char* currentTextBreakLocaleID()
 {
-    notImplemented();
-    return "en_us";
+    return currentLocaleID();
 }
 
 } // namespace WebCore

Other related posts:

  • » [haiku-webkit-commits] r256 - in webkit/trunk/WebCore: . platform/text/haiku - webkit