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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 localeName = localeName.lower(); | 114 localeName = localeName.lower(); |
115 do { | 115 do { |
116 NameToLCIDMap::const_iterator iterator = map.find(localeName); | 116 NameToLCIDMap::const_iterator iterator = map.find(localeName); |
117 if (iterator != map.end()) | 117 if (iterator != map.end()) |
118 return iterator->value; | 118 return iterator->value; |
119 localeName = removeLastComponent(localeName); | 119 localeName = removeLastComponent(localeName); |
120 } while (!localeName.isEmpty()); | 120 } while (!localeName.isEmpty()); |
121 return LOCALE_USER_DEFAULT; | 121 return LOCALE_USER_DEFAULT; |
122 } | 122 } |
123 | 123 |
124 static LCID LCIDFromLocaleInternal(LCID userDefaultLCID, const String& userDefau
ltLanguageCode, LocaleNameToLCIDPtr localeNameToLCID, const String& locale) | 124 static LCID LCIDFromLocaleInternal(LCID userDefaultLCID, const String& userDefau
ltLanguageCode, LocaleNameToLCIDPtr localeNameToLCID, String& locale) |
125 { | 125 { |
126 String localeLanguageCode = extractLanguageCode(locale); | 126 String localeLanguageCode = extractLanguageCode(locale); |
127 if (equalIgnoringCase(localeLanguageCode, userDefaultLanguageCode)) | 127 if (equalIgnoringCase(localeLanguageCode, userDefaultLanguageCode)) |
128 return userDefaultLCID; | 128 return userDefaultLCID; |
129 return localeNameToLCID(locale.charactersWithNullTermination().data(), 0); | 129 return localeNameToLCID(locale.charactersWithNullTermination().data(), 0); |
130 } | 130 } |
131 | 131 |
132 static LCID LCIDFromLocale(const AtomicString& locale, bool defaultsForLocale) | 132 static LCID LCIDFromLocale(const AtomicString& locale, bool defaultsForLocale) |
133 { | 133 { |
134 // LocaleNameToLCID() is available since Windows Vista. | 134 // LocaleNameToLCID() is available since Windows Vista. |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 case NegativeFormatSignPrefix: // Fall through. | 578 case NegativeFormatSignPrefix: // Fall through. |
579 default: | 579 default: |
580 negativePrefix = negativeSign; | 580 negativePrefix = negativeSign; |
581 break; | 581 break; |
582 } | 582 } |
583 m_didInitializeNumberData = true; | 583 m_didInitializeNumberData = true; |
584 setLocaleData(symbols, emptyString(), emptyString(), negativePrefix, negativ
eSuffix); | 584 setLocaleData(symbols, emptyString(), emptyString(), negativePrefix, negativ
eSuffix); |
585 } | 585 } |
586 | 586 |
587 } | 587 } |
OLD | NEW |