[webkit-reviews] review granted: [Bug 99963] Introduce Localizer::standAloneMonthLabels : [Attachment 169841] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 22 05:52:17 PDT 2012


Kentaro Hara <haraken at chromium.org> has granted Kent Tamura
<tkent at chromium.org>'s request for review:
Bug 99963: Introduce Localizer::standAloneMonthLabels
https://bugs.webkit.org/show_bug.cgi?id=99963

Attachment 169841: Patch
https://bugs.webkit.org/attachment.cgi?id=169841&action=review

------- Additional Comments from Kentaro Hara <haraken at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=169841&action=review


> Source/WebCore/platform/text/LocaleICU.cpp:334
> +    if (m_monthLabels)

This should be:

  if (!m_monthLabels.isEmpty())

> Source/WebCore/platform/text/LocaleICU.cpp:343
> +    if (!initializeShortDateFormat()) {
> +	   m_monthLabels = createFallbackMonthLabels();
> +	   return *m_monthLabels;
> +    }
> +    m_monthLabels = createLabelVector(m_shortDateFormat, UDAT_MONTHS,
UCAL_JANUARY, 12);
> +    if (m_monthLabels)
> +	   return *m_monthLabels;
> +    m_monthLabels = createFallbackMonthLabels();

Just like LocaleICU::standAloneMonthLabels(), I would prefer:

if (initializeShortDateFormat()) {
  if (OwnPtr<Vector<String> > labels = createLabelVector(m_shortDateFormat,
UDAT_MONTHS, UCAL_JANUARY, 12)) {
    m_monthLabels = labels;
    return *m_monthLabels;
  }
}
m_monthLabels = createFallbackMonthLabels();


More information about the webkit-reviews mailing list