Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1806)

Unified Diff: Source/core/platform/text/LocaleWin.cpp

Issue 25674007: Remove core/platform/text/{mac, win} (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/text/LocaleWin.h ('k') | Source/core/platform/text/mac/LocaleMac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/text/LocaleWin.cpp
diff --git a/Source/core/platform/text/win/LocaleWin.cpp b/Source/core/platform/text/LocaleWin.cpp
similarity index 98%
rename from Source/core/platform/text/win/LocaleWin.cpp
rename to Source/core/platform/text/LocaleWin.cpp
index 39ef416f81b4332ca20d659294c33b36137086a4..b93c0e6be30d6620c2c7a1e58743b5c7a56c870c 100644
--- a/Source/core/platform/text/win/LocaleWin.cpp
+++ b/Source/core/platform/text/LocaleWin.cpp
@@ -29,10 +29,8 @@
*/
#include "config.h"
-#include "core/platform/text/win/LocaleWin.h"
+#include "core/platform/text/LocaleWin.h"
-#include <windows.h>
-#include <limits>
#include "platform/DateComponents.h"
#include "platform/Language.h"
#include "platform/LayoutTestSupport.h"
@@ -46,6 +44,8 @@
#include "wtf/text/StringBuffer.h"
#include "wtf/text/StringBuilder.h"
#include "wtf/text/StringHash.h"
+#include <limits>
+#include <windows.h>
using namespace std;
@@ -280,10 +280,12 @@ static String convertWindowsDateTimeFormat(const String& format)
if (lastQuoteCanBeLiteral && format[i - 1] == '\'') {
literalBuffer.append('\'');
lastQuoteCanBeLiteral = false;
- } else
+ } else {
lastQuoteCanBeLiteral = true;
- } else
+ }
+ } else {
literalBuffer.append(ch);
+ }
continue;
}
@@ -292,16 +294,17 @@ static String convertWindowsDateTimeFormat(const String& format)
if (lastQuoteCanBeLiteral && i > 0 && format[i - 1] == '\'') {
literalBuffer.append(ch);
lastQuoteCanBeLiteral = false;
- } else
+ } else {
lastQuoteCanBeLiteral = true;
+ }
} else if (isASCIIAlpha(ch)) {
commitLiteralToken(literalBuffer, converted);
unsigned symbolStart = i;
unsigned count = countContinuousLetters(format, i);
i += count - 1;
- if (ch == 'h' || ch == 'H' || ch == 'm' || ch == 's' || ch == 'M' || ch == 'y')
+ if (ch == 'h' || ch == 'H' || ch == 'm' || ch == 's' || ch == 'M' || ch == 'y') {
converted.append(format, symbolStart, count);
- else if (ch == 'd') {
+ } else if (ch == 'd') {
if (count <= 2)
converted.append(format, symbolStart, count);
else if (count == 3)
@@ -309,18 +312,20 @@ static String convertWindowsDateTimeFormat(const String& format)
else
converted.append("EEEE");
} else if (ch == 'g') {
- if (count == 1)
+ if (count == 1) {
converted.append('G');
- else {
+ } else {
// gg means imperial era in Windows.
// Just ignore it.
}
- } else if (ch == 't')
+ } else if (ch == 't') {
converted.append('a');
- else
+ } else {
literalBuffer.append(format, symbolStart, count);
- } else
+ }
+ } else {
literalBuffer.append(ch);
+ }
}
commitLiteralToken(literalBuffer, converted);
return converted.toString();
« no previous file with comments | « Source/core/platform/text/LocaleWin.h ('k') | Source/core/platform/text/mac/LocaleMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698