Title: [130243] trunk/Source/WebCore
Revision
130243
Author
tk...@chromium.org
Date
2012-10-02 18:25:29 -0700 (Tue, 02 Oct 2012)

Log Message

[Mac][Chromium-Mac] Implement LocaleMac::dateFormat
https://bugs.webkit.org/show_bug.cgi?id=98116

Reviewed by Hajime Morita.

http://trac.webkit.org/changeset/130127 introduced
Localizer::dateFormat, and this is its implementation for LocaleICU
classs. The code is going to be used when
ENABLE_INPUT_MULTIPLE_FIELDS_UI is enabled.

No new tests. The function is not used yet.

* platform/text/mac/LocaleMac.h:
(LocaleMac): Declare m_dateFormat.
* platform/text/mac/LocaleMac.mm:
(WebCore::LocaleMac::dateFormat): Implemented.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (130242 => 130243)


--- trunk/Source/WebCore/ChangeLog	2012-10-03 01:17:15 UTC (rev 130242)
+++ trunk/Source/WebCore/ChangeLog	2012-10-03 01:25:29 UTC (rev 130243)
@@ -1,5 +1,24 @@
 2012-10-02  Kent Tamura  <tk...@chromium.org>
 
+        [Mac][Chromium-Mac] Implement LocaleMac::dateFormat
+        https://bugs.webkit.org/show_bug.cgi?id=98116
+
+        Reviewed by Hajime Morita.
+
+        http://trac.webkit.org/changeset/130127 introduced
+        Localizer::dateFormat, and this is its implementation for LocaleICU
+        classs. The code is going to be used when
+        ENABLE_INPUT_MULTIPLE_FIELDS_UI is enabled.
+
+        No new tests. The function is not used yet.
+
+        * platform/text/mac/LocaleMac.h:
+        (LocaleMac): Declare m_dateFormat.
+        * platform/text/mac/LocaleMac.mm:
+        (WebCore::LocaleMac::dateFormat): Implemented.
+
+2012-10-02  Kent Tamura  <tk...@chromium.org>
+
         [Chromium-Win] Implement LocaleWin::dateFormat
         https://bugs.webkit.org/show_bug.cgi?id=98117
 

Modified: trunk/Source/WebCore/platform/text/mac/LocaleMac.h (130242 => 130243)


--- trunk/Source/WebCore/platform/text/mac/LocaleMac.h	2012-10-03 01:17:15 UTC (rev 130242)
+++ trunk/Source/WebCore/platform/text/mac/LocaleMac.h	2012-10-03 01:25:29 UTC (rev 130243)
@@ -82,6 +82,7 @@
     NSDateFormatter *createTimeFormatter();
     NSDateFormatter *createShortTimeFormatter();
 
+    String m_dateFormat;
     String m_localizedTimeFormatText;
     String m_localizedShortTimeFormatText;
     Vector<String> m_timeAMPMLabels;

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


--- trunk/Source/WebCore/platform/text/mac/LocaleMac.mm	2012-10-03 01:17:15 UTC (rev 130242)
+++ trunk/Source/WebCore/platform/text/mac/LocaleMac.mm	2012-10-03 01:25:29 UTC (rev 130243)
@@ -254,8 +254,11 @@
 
 String LocaleMac::dateFormat()
 {
-    // FIXME: We should have real implementation of LocaleMac::dateFormat().
-    return emptyString();
+    if (!m_dateFormat.isEmpty())
+        return m_dateFormat;
+    RetainPtr<NSDateFormatter> formatter(AdoptNS, createShortDateFormatter());
+    m_dateFormat = String([formatter.get() dateFormat]);
+    return m_dateFormat;
 }
 
 String LocaleMac::timeFormat()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to