Move the content of LocalizedCalendarICU.cpp and LocalizedDateICU.cpp to ICULocale...
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Apr 2012 00:47:22 +0000 (00:47 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Apr 2012 00:47:22 +0000 (00:47 +0000)
commit3337f23f2946859da95cd3a51866a51b2321ff16
tree43c02ac35f3a7c2e252efde9a4ddab1750a5b45f
parentb149b6d1ac2f5d245e2041412cb5e5d6b8eb7689
Move the content of LocalizedCalendarICU.cpp and LocalizedDateICU.cpp to ICULocale.cpp.
https://bugs.webkit.org/show_bug.cgi?id=84568

Reviewed by Hajime Morita.

Move it to ICULocal.cpp because we want to share UDateFormat
object in LocalizedDate functions and LocalizedCalendar functions,
and it becomes easier to cache the UDateFormat object, and making
unit tests for these functions easier.

No new tests because of no bahevior changes.

* platform/text/ICULocale.cpp:
(WebCore::ICULocale::ICULocale): Initialize new members.
(WebCore::ICULocale::~ICULocale): Delete m_shortDateFormat.
(WebCore::ICULocale::initializeShortDateFormat):
Moved from creteShortDateFormatter of LocalizedDateICU.cpp.
(WebCore::ICULocale::parseLocalizedDate):
Moved from LocalizedDate.cpp, use m_shortDateFormat.
(WebCore::ICULocale::formatLocalizedDate): ditto.
(WebCore::ICULocale::createLabelVector):
Moved from LocalizedCalendarICU.cpp, use m_shortDateFormat.
(WebCore::createFallbackMonthLabels): Moved from LocalizedCalendarICU.cpp.
(WebCore::createFallbackWeekDayShortLabels): ditto.
(WebCore::ICULocale::initializeCalendar):
lazy initialization of m_monthLabels, m_weekDayShortLabels, and m_firstDayOfWeek.
(WebCore::ICULocale::monthLabels):
(WebCore::ICULocale::weekDayShortLabels):
(WebCore::ICULocale::firstDayOfWeek):
* platform/text/ICULocale.h:
(ICULocale): Add declarations.
* platform/text/LocalizedCalendarICU.cpp:
(WebCore::monthLabels): Use ICULocale::currentLocale().
(WebCore::weekDayShortLabels): ditto.
(WebCore::firstDayOfWeek): ditto.
* platform/text/LocalizedDateICU.cpp:
(WebCore::parseLocalizedDate): ditto.
(WebCore::formatLocalizedDate): ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/text/ICULocale.cpp
Source/WebCore/platform/text/ICULocale.h
Source/WebCore/platform/text/LocalizedCalendarICU.cpp
Source/WebCore/platform/text/LocalizedDateICU.cpp