| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011,2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011,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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 position += m_decimalSymbols[symbolIndex].length(); | 344 position += m_decimalSymbols[symbolIndex].length(); |
| 345 return symbolIndex; | 345 return symbolIndex; |
| 346 } | 346 } |
| 347 } | 347 } |
| 348 return DecimalSymbolsSize; | 348 return DecimalSymbolsSize; |
| 349 } | 349 } |
| 350 | 350 |
| 351 String Locale::convertFromLocalizedNumber(const String& localized) | 351 String Locale::convertFromLocalizedNumber(const String& localized) |
| 352 { | 352 { |
| 353 initializeLocaleData(); | 353 initializeLocaleData(); |
| 354 String input = localized.stripWhiteSpace(); | 354 String input = localized.removeCharacters(isASCIISpace); |
| 355 if (!m_hasLocaleData || input.isEmpty()) | 355 if (!m_hasLocaleData || input.isEmpty()) |
| 356 return input; | 356 return input; |
| 357 | 357 |
| 358 bool isNegative; | 358 bool isNegative; |
| 359 unsigned startIndex; | 359 unsigned startIndex; |
| 360 unsigned endIndex; | 360 unsigned endIndex; |
| 361 if (!detectSignAndGetDigitRange(input, isNegative, startIndex, endIndex)) | 361 if (!detectSignAndGetDigitRange(input, isNegative, startIndex, endIndex)) |
| 362 return input; | 362 return input; |
| 363 | 363 |
| 364 StringBuilder builder; | 364 StringBuilder builder; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 builder.build(formatType == FormatTypeShort ? dateTimeFormatWithoutSecon
ds() : dateTimeFormatWithSeconds()); | 411 builder.build(formatType == FormatTypeShort ? dateTimeFormatWithoutSecon
ds() : dateTimeFormatWithSeconds()); |
| 412 break; | 412 break; |
| 413 case DateComponents::Invalid: | 413 case DateComponents::Invalid: |
| 414 ASSERT_NOT_REACHED(); | 414 ASSERT_NOT_REACHED(); |
| 415 break; | 415 break; |
| 416 } | 416 } |
| 417 return builder.toString(); | 417 return builder.toString(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 } | 420 } |
| OLD | NEW |