Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 static String convertWindowsDateTimeFormat(const String& format) { | 200 static String convertWindowsDateTimeFormat(const String& format) { |
| 201 StringBuilder converted; | 201 StringBuilder converted; |
| 202 StringBuilder literalBuffer; | 202 StringBuilder literalBuffer; |
| 203 bool inQuote = false; | 203 bool inQuote = false; |
| 204 bool lastQuoteCanBeLiteral = false; | 204 bool lastQuoteCanBeLiteral = false; |
| 205 for (unsigned i = 0; i < format.length(); ++i) { | 205 for (unsigned i = 0; i < format.length(); ++i) { |
| 206 UChar ch = format[i]; | 206 UChar ch = format[i]; |
| 207 if (inQuote) { | 207 if (inQuote) { |
| 208 if (ch == '\'') { | 208 if (ch == '\'') { |
| 209 inQuote = false; | 209 inQuote = false; |
| 210 ASSERT(i); | 210 DCHECK(i); |
| 211 if (lastQuoteCanBeLiteral && format[i - 1] == '\'') { | 211 if (lastQuoteCanBeLiteral && format[i - 1] == '\'') { |
| 212 literalBuffer.append('\''); | 212 literalBuffer.append('\''); |
| 213 lastQuoteCanBeLiteral = false; | 213 lastQuoteCanBeLiteral = false; |
| 214 } else { | 214 } else { |
| 215 lastQuoteCanBeLiteral = true; | 215 lastQuoteCanBeLiteral = true; |
| 216 } | 216 } |
| 217 } else { | 217 } else { |
| 218 literalBuffer.append(ch); | 218 literalBuffer.append(ch); |
| 219 } | 219 } |
| 220 continue; | 220 continue; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 symbols.push_back("2"); | 443 symbols.push_back("2"); |
| 444 symbols.push_back("3"); | 444 symbols.push_back("3"); |
| 445 symbols.push_back("4"); | 445 symbols.push_back("4"); |
| 446 symbols.push_back("5"); | 446 symbols.push_back("5"); |
| 447 symbols.push_back("6"); | 447 symbols.push_back("6"); |
| 448 symbols.push_back("7"); | 448 symbols.push_back("7"); |
| 449 symbols.push_back("8"); | 449 symbols.push_back("8"); |
| 450 symbols.push_back("9"); | 450 symbols.push_back("9"); |
| 451 } else { | 451 } else { |
| 452 String digits = getLocaleInfoString(LOCALE_SNATIVEDIGITS); | 452 String digits = getLocaleInfoString(LOCALE_SNATIVEDIGITS); |
| 453 ASSERT(digits.length() >= 10); | 453 DCHECK_GE(digits.length(), 10u); |
| 454 for (unsigned i = 0; i < 10; ++i) | 454 for (unsigned i = 0; i < 10; ++i) |
| 455 symbols.push_back(digits.substring(i, 1)); | 455 symbols.push_back(digits.substring(i, 1)); |
| 456 } | 456 } |
| 457 ASSERT(symbols.size() == DecimalSeparatorIndex); | 457 DCHECK(symbols.size() == DecimalSeparatorIndex); |
|
tkent
2017/04/09 23:07:01
Use DCHECK_EQ if it doesn't cause a compile failur
Hwanseung Lee
2017/04/11 03:29:38
it was cause a compile failure.
| |
| 458 symbols.push_back(getLocaleInfoString(LOCALE_SDECIMAL)); | 458 symbols.push_back(getLocaleInfoString(LOCALE_SDECIMAL)); |
| 459 ASSERT(symbols.size() == GroupSeparatorIndex); | 459 DCHECK(symbols.size() == GroupSeparatorIndex); |
|
tkent
2017/04/09 23:07:01
Use DCHECK_EQ if it doesn't cause a compile failur
Hwanseung Lee
2017/04/11 03:29:38
it was cause a compile failure.
| |
| 460 symbols.push_back(getLocaleInfoString(LOCALE_STHOUSAND)); | 460 symbols.push_back(getLocaleInfoString(LOCALE_STHOUSAND)); |
| 461 ASSERT(symbols.size() == DecimalSymbolsSize); | 461 DCHECK(symbols.size() == DecimalSymbolsSize); |
|
tkent
2017/04/09 23:07:01
Use DCHECK_EQ if it doesn't cause a compile failur
Hwanseung Lee
2017/04/11 03:29:38
it was cause a compile failure.
| |
| 462 | 462 |
| 463 String negativeSign = getLocaleInfoString(LOCALE_SNEGATIVESIGN); | 463 String negativeSign = getLocaleInfoString(LOCALE_SNEGATIVESIGN); |
| 464 enum NegativeFormat { | 464 enum NegativeFormat { |
| 465 NegativeFormatParenthesis = 0, | 465 NegativeFormatParenthesis = 0, |
| 466 NegativeFormatSignPrefix = 1, | 466 NegativeFormatSignPrefix = 1, |
| 467 NegativeFormatSignSpacePrefix = 2, | 467 NegativeFormatSignSpacePrefix = 2, |
| 468 NegativeFormatSignSuffix = 3, | 468 NegativeFormatSignSuffix = 3, |
| 469 NegativeFormatSpaceSignSuffix = 4, | 469 NegativeFormatSpaceSignSuffix = 4, |
| 470 }; | 470 }; |
| 471 DWORD negativeFormat = NegativeFormatSignPrefix; | 471 DWORD negativeFormat = NegativeFormatSignPrefix; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 489 case NegativeFormatSignPrefix: // Fall through. | 489 case NegativeFormatSignPrefix: // Fall through. |
| 490 default: | 490 default: |
| 491 negativePrefix = negativeSign; | 491 negativePrefix = negativeSign; |
| 492 break; | 492 break; |
| 493 } | 493 } |
| 494 m_didInitializeNumberData = true; | 494 m_didInitializeNumberData = true; |
| 495 setLocaleData(symbols, emptyString, emptyString, negativePrefix, | 495 setLocaleData(symbols, emptyString, emptyString, negativePrefix, |
| 496 negativeSuffix); | 496 negativeSuffix); |
| 497 } | 497 } |
| 498 } | 498 } |
| OLD | NEW |