Bug 99787 - Add shortMonthLabels and shortStandAloneMonthLabels to Localizer
Summary: Add shortMonthLabels and shortStandAloneMonthLabels to Localizer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kent Tamura
URL:
Keywords:
Depends on: 99704
Blocks: 99818
  Show dependency treegraph
 
Reported: 2012-10-18 18:15 PDT by Kent Tamura
Modified: 2012-10-19 00:07 PDT (History)
2 users (show)

See Also:


Attachments
Patch (18.90 KB, patch)
2012-10-18 21:40 PDT, Kent Tamura
haraken: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2012-10-18 18:15:11 PDT
because Localizer::monthFormat can contain MMM or LLL.
See http://www.unicode.org/reports/tr35/#Date_Format_Patterns
Comment 1 Kent Tamura 2012-10-18 21:40:25 PDT
Created attachment 169544 [details]
Patch
Comment 2 Kentaro Hara 2012-10-18 21:55:04 PDT
Comment on attachment 169544 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169544&action=review

> Source/WebCore/platform/text/LocaleICU.cpp:466
> +            m_shortStandAloneMonthLabels = *labels;

Nit: I would prefer early return here. 'return m_shortStandAloneMonthLabels;'

> Source/WebCore/platform/text/LocaleICU.cpp:468
> +    if (m_shortStandAloneMonthLabels.isEmpty())

Then you can remove this branch.

> Source/WebCore/platform/text/LocaleNone.cpp:99
> +    m_shortMonthLabels.reserveCapacity(12);

Nit: 12 => WTF_ARRAY_LENGTH(WTF::monthName)
Comment 3 Kent Tamura 2012-10-18 22:05:15 PDT
Comment on attachment 169544 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169544&action=review

>> Source/WebCore/platform/text/LocaleICU.cpp:466
>> +            m_shortStandAloneMonthLabels = *labels;
> 
> Nit: I would prefer early return here. 'return m_shortStandAloneMonthLabels;'

Done.

>> Source/WebCore/platform/text/LocaleNone.cpp:99
>> +    m_shortMonthLabels.reserveCapacity(12);
> 
> Nit: 12 => WTF_ARRAY_LENGTH(WTF::monthName)

Done.
Comment 4 Kent Tamura 2012-10-18 22:08:53 PDT
Committed r131854: <http://trac.webkit.org/changeset/131854>