Title: [128156] trunk/Source
Revision
128156
Author
[email protected]
Date
2012-09-11 01:15:20 -0700 (Tue, 11 Sep 2012)

Log Message

Create Localizer factory method for LocaleMac
https://bugs.webkit.org/show_bug.cgi?id=96355

Reviewed by Kent Tamura.

Source/WebCore:

Preparing to use Localizer instead of LocaleMac/Win/ICU

No new tests. Covered in unit test tests/LocaleMacTest.cpp

* platform/text/Localizer.h:
(Localizer):
* platform/text/mac/LocaleMac.mm:
(WebCore::Localizer::create):
(WebCore):

Source/WebKit/chromium:

* tests/LocaleMacTest.cpp:
(testNumberIsReversible): Use Localizer::create.
(testNumbers):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (128155 => 128156)


--- trunk/Source/WebCore/ChangeLog	2012-09-11 08:07:36 UTC (rev 128155)
+++ trunk/Source/WebCore/ChangeLog	2012-09-11 08:15:20 UTC (rev 128156)
@@ -1,3 +1,20 @@
+2012-09-11  Keishi Hattori  <[email protected]>
+
+        Create Localizer factory method for LocaleMac
+        https://bugs.webkit.org/show_bug.cgi?id=96355
+
+        Reviewed by Kent Tamura.
+
+        Preparing to use Localizer instead of LocaleMac/Win/ICU
+
+        No new tests. Covered in unit test tests/LocaleMacTest.cpp
+
+        * platform/text/Localizer.h:
+        (Localizer):
+        * platform/text/mac/LocaleMac.mm:
+        (WebCore::Localizer::create):
+        (WebCore):
+
 2012-09-11  Mihnea Ovidenie  <[email protected]>
 
         [CSS Regions] Auto width is not working for Regions

Modified: trunk/Source/WebCore/platform/text/Localizer.h (128155 => 128156)


--- trunk/Source/WebCore/platform/text/Localizer.h	2012-09-11 08:07:36 UTC (rev 128155)
+++ trunk/Source/WebCore/platform/text/Localizer.h	2012-09-11 08:15:20 UTC (rev 128156)
@@ -32,6 +32,7 @@
 
 class Localizer {
 public:
+    static PassOwnPtr<Localizer> create(const AtomicString&);
     String convertToLocalizedNumber(const String&);
     String convertFromLocalizedNumber(const String&);
 #if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)

Modified: trunk/Source/WebCore/platform/text/mac/LocaleMac.mm (128155 => 128156)


--- trunk/Source/WebCore/platform/text/mac/LocaleMac.mm	2012-09-11 08:07:36 UTC (rev 128155)
+++ trunk/Source/WebCore/platform/text/mac/LocaleMac.mm	2012-09-11 08:15:20 UTC (rev 128156)
@@ -45,6 +45,11 @@
 
 namespace WebCore {
 
+PassOwnPtr<Localizer> Localizer::create(const AtomicString& locale)
+{
+    return LocaleMac::create(locale.string());
+}
+
 static NSDateFormatter* createDateTimeFormatter(NSLocale* locale, NSDateFormatterStyle dateStyle, NSDateFormatterStyle timeStyle)
 {
     NSDateFormatter *formatter = [[NSDateFormatter alloc] init];

Modified: trunk/Source/WebKit/chromium/ChangeLog (128155 => 128156)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-09-11 08:07:36 UTC (rev 128155)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-09-11 08:15:20 UTC (rev 128156)
@@ -1,3 +1,14 @@
+2012-09-11  Keishi Hattori  <[email protected]>
+
+        Create Localizer factory method for LocaleMac
+        https://bugs.webkit.org/show_bug.cgi?id=96355
+
+        Reviewed by Kent Tamura.
+
+        * tests/LocaleMacTest.cpp:
+        (testNumberIsReversible): Use Localizer::create.
+        (testNumbers):
+
 2012-09-11  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r128150.

Modified: trunk/Source/WebKit/chromium/tests/LocaleMacTest.cpp (128155 => 128156)


--- trunk/Source/WebKit/chromium/tests/LocaleMacTest.cpp	2012-09-11 08:07:36 UTC (rev 128155)
+++ trunk/Source/WebKit/chromium/tests/LocaleMacTest.cpp	2012-09-11 08:15:20 UTC (rev 128156)
@@ -221,9 +221,9 @@
 }
 #endif
 
-static void testNumberIsReversible(const String& localeString, const char* original, const char* shouldHave = 0)
+static void testNumberIsReversible(const AtomicString& localeString, const char* original, const char* shouldHave = 0)
 {
-    OwnPtr<LocaleMac> locale = LocaleMac::create(localeString);
+    OwnPtr<Localizer> locale = Localizer::create(localeString);
     String localized = locale->convertToLocalizedNumber(original);
     if (shouldHave)
         EXPECT_TRUE(localized.contains(shouldHave));
@@ -231,7 +231,7 @@
     EXPECT_STREQ(original, converted.utf8().data());
 }
 
-void testNumbers(const String& localeString, const char* decimalSeparatorShouldBe = 0)
+void testNumbers(const AtomicString& localeString, const char* decimalSeparatorShouldBe = 0)
 {
     testNumberIsReversible(localeString, "123456789012345678901234567890");
     testNumberIsReversible(localeString, "-123.456", decimalSeparatorShouldBe);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to