Changeset 128156 in webkit


Ignore:
Timestamp:
Sep 11, 2012 1:15:20 AM (12 years ago)
Author:
keishi@webkit.org
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):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128155 r128156  
     12012-09-11  Keishi Hattori  <keishi@webkit.org>
     2
     3        Create Localizer factory method for LocaleMac
     4        https://bugs.webkit.org/show_bug.cgi?id=96355
     5
     6        Reviewed by Kent Tamura.
     7
     8        Preparing to use Localizer instead of LocaleMac/Win/ICU
     9
     10        No new tests. Covered in unit test tests/LocaleMacTest.cpp
     11
     12        * platform/text/Localizer.h:
     13        (Localizer):
     14        * platform/text/mac/LocaleMac.mm:
     15        (WebCore::Localizer::create):
     16        (WebCore):
     17
    1182012-09-11  Mihnea Ovidenie  <mihnea@adobe.com>
    219
  • trunk/Source/WebCore/platform/text/Localizer.h

    r128147 r128156  
    3333class Localizer {
    3434public:
     35    static PassOwnPtr<Localizer> create(const AtomicString&);
    3536    String convertToLocalizedNumber(const String&);
    3637    String convertFromLocalizedNumber(const String&);
  • trunk/Source/WebCore/platform/text/mac/LocaleMac.mm

    r128147 r128156  
    4646namespace WebCore {
    4747
     48PassOwnPtr<Localizer> Localizer::create(const AtomicString& locale)
     49{
     50    return LocaleMac::create(locale.string());
     51}
     52
    4853static NSDateFormatter* createDateTimeFormatter(NSLocale* locale, NSDateFormatterStyle dateStyle, NSDateFormatterStyle timeStyle)
    4954{
  • trunk/Source/WebKit/chromium/ChangeLog

    r128151 r128156  
     12012-09-11  Keishi Hattori  <keishi@webkit.org>
     2
     3        Create Localizer factory method for LocaleMac
     4        https://bugs.webkit.org/show_bug.cgi?id=96355
     5
     6        Reviewed by Kent Tamura.
     7
     8        * tests/LocaleMacTest.cpp:
     9        (testNumberIsReversible): Use Localizer::create.
     10        (testNumbers):
     11
    1122012-09-11  Sheriff Bot  <webkit.review.bot@gmail.com>
    213
  • trunk/Source/WebKit/chromium/tests/LocaleMacTest.cpp

    r125141 r128156  
    222222#endif
    223223
    224 static void testNumberIsReversible(const String& localeString, const char* original, const char* shouldHave = 0)
    225 {
    226     OwnPtr<LocaleMac> locale = LocaleMac::create(localeString);
     224static void testNumberIsReversible(const AtomicString& localeString, const char* original, const char* shouldHave = 0)
     225{
     226    OwnPtr<Localizer> locale = Localizer::create(localeString);
    227227    String localized = locale->convertToLocalizedNumber(original);
    228228    if (shouldHave)
     
    232232}
    233233
    234 void testNumbers(const String& localeString, const char* decimalSeparatorShouldBe = 0)
     234void testNumbers(const AtomicString& localeString, const char* decimalSeparatorShouldBe = 0)
    235235{
    236236    testNumberIsReversible(localeString, "123456789012345678901234567890");
Note: See TracChangeset for help on using the changeset viewer.