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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 LCID lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, | 83 LCID lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, |
84 userDefaultLanguageCode, locale); | 84 userDefaultLanguageCode, locale); |
85 if (!lcid) | 85 if (!lcid) |
86 lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, userDefaultLanguageCode, | 86 lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, userDefaultLanguageCode, |
87 defaultLanguage()); | 87 defaultLanguage()); |
88 return lcid; | 88 return lcid; |
89 } | 89 } |
90 | 90 |
91 std::unique_ptr<Locale> Locale::create(const String& locale) { | 91 std::unique_ptr<Locale> Locale::create(const String& locale) { |
92 // Whether the default settings for the locale should be used, ignoring user o
verrides. | 92 // Whether the default settings for the locale should be used, ignoring user |
| 93 // overrides. |
93 bool defaultsForLocale = LayoutTestSupport::isRunningLayoutTest(); | 94 bool defaultsForLocale = LayoutTestSupport::isRunningLayoutTest(); |
94 return LocaleWin::create(LCIDFromLocale(locale, defaultsForLocale), | 95 return LocaleWin::create(LCIDFromLocale(locale, defaultsForLocale), |
95 defaultsForLocale); | 96 defaultsForLocale); |
96 } | 97 } |
97 | 98 |
98 inline LocaleWin::LocaleWin(LCID lcid, bool defaultsForLocale) | 99 inline LocaleWin::LocaleWin(LCID lcid, bool defaultsForLocale) |
99 : m_lcid(lcid), | 100 : m_lcid(lcid), |
100 m_didInitializeNumberData(false), | 101 m_didInitializeNumberData(false), |
101 m_defaultsForLocale(defaultsForLocale) { | 102 m_defaultsForLocale(defaultsForLocale) { |
102 DWORD value = 0; | 103 DWORD value = 0; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 case NegativeFormatSignPrefix: // Fall through. | 489 case NegativeFormatSignPrefix: // Fall through. |
489 default: | 490 default: |
490 negativePrefix = negativeSign; | 491 negativePrefix = negativeSign; |
491 break; | 492 break; |
492 } | 493 } |
493 m_didInitializeNumberData = true; | 494 m_didInitializeNumberData = true; |
494 setLocaleData(symbols, emptyString(), emptyString(), negativePrefix, | 495 setLocaleData(symbols, emptyString(), emptyString(), negativePrefix, |
495 negativeSuffix); | 496 negativeSuffix); |
496 } | 497 } |
497 } | 498 } |
OLD | NEW |