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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 getLocaleInfo( | 104 getLocaleInfo( |
105 LOCALE_IFIRSTDAYOFWEEK | (defaultsForLocale ? LOCALE_NOUSEROVERRIDE : 0), | 105 LOCALE_IFIRSTDAYOFWEEK | (defaultsForLocale ? LOCALE_NOUSEROVERRIDE : 0), |
106 value); | 106 value); |
107 // 0:Monday, ..., 6:Sunday. | 107 // 0:Monday, ..., 6:Sunday. |
108 // We need 1 for Monday, 0 for Sunday. | 108 // We need 1 for Monday, 0 for Sunday. |
109 m_firstDayOfWeek = (value + 1) % 7; | 109 m_firstDayOfWeek = (value + 1) % 7; |
110 } | 110 } |
111 | 111 |
112 std::unique_ptr<LocaleWin> LocaleWin::create(LCID lcid, | 112 std::unique_ptr<LocaleWin> LocaleWin::create(LCID lcid, |
113 bool defaultsForLocale) { | 113 bool defaultsForLocale) { |
114 return wrapUnique(new LocaleWin(lcid, defaultsForLocale)); | 114 return WTF::wrapUnique(new LocaleWin(lcid, defaultsForLocale)); |
115 } | 115 } |
116 | 116 |
117 LocaleWin::~LocaleWin() {} | 117 LocaleWin::~LocaleWin() {} |
118 | 118 |
119 String LocaleWin::getLocaleInfoString(LCTYPE type) { | 119 String LocaleWin::getLocaleInfoString(LCTYPE type) { |
120 int bufferSizeWithNUL = ::GetLocaleInfo( | 120 int bufferSizeWithNUL = ::GetLocaleInfo( |
121 m_lcid, type | (m_defaultsForLocale ? LOCALE_NOUSEROVERRIDE : 0), 0, 0); | 121 m_lcid, type | (m_defaultsForLocale ? LOCALE_NOUSEROVERRIDE : 0), 0, 0); |
122 if (bufferSizeWithNUL <= 0) | 122 if (bufferSizeWithNUL <= 0) |
123 return String(); | 123 return String(); |
124 StringBuffer<UChar> buffer(bufferSizeWithNUL); | 124 StringBuffer<UChar> buffer(bufferSizeWithNUL); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |