diff options
author | Matt Ellis <matell@microsoft.com> | 2015-10-15 11:20:59 -0700 |
---|---|---|
committer | Matt Ellis <matell@microsoft.com> | 2015-10-21 13:49:00 -0700 |
commit | 39edeba2aeb24623425a72f95aa748e51e6242fe (patch) | |
tree | 14863512243b99d391c29b19d831e89492ff77c3 /src/corefx | |
parent | 9945e4f995673116a82b73e63520c536ada6934c (diff) | |
download | coreclr-39edeba2aeb24623425a72f95aa748e51e6242fe.tar.gz coreclr-39edeba2aeb24623425a72f95aa748e51e6242fe.tar.bz2 coreclr-39edeba2aeb24623425a72f95aa748e51e6242fe.zip |
Remove use of ICU C++ DateFormatSymbols
Diffstat (limited to 'src/corefx')
-rw-r--r-- | src/corefx/System.Globalization.Native/localeStringData.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/corefx/System.Globalization.Native/localeStringData.cpp b/src/corefx/System.Globalization.Native/localeStringData.cpp index 0dbae258a0..a87ba06622 100644 --- a/src/corefx/System.Globalization.Native/localeStringData.cpp +++ b/src/corefx/System.Globalization.Native/localeStringData.cpp @@ -102,31 +102,21 @@ UErrorCode GetDigitSymbol(const Locale& locale, Function: GetLocaleInfoAmPm -Obtains the value of a DateFormatSymbols Am or Pm string +Obtains the value of the AM or PM string for a locale. */ UErrorCode GetLocaleInfoAmPm(const Locale& locale, bool am, UChar* value, int32_t valueLength) { UErrorCode status = U_ZERO_ERROR; - LocalPointer<DateFormatSymbols> dateFormatSymbols(new DateFormatSymbols(locale, status)); - if (dateFormatSymbols == NULL) - { - status = U_MEMORY_ALLOCATION_ERROR; - } + UDateFormat* pFormat = udat_open(UDAT_DEFAULT, UDAT_DEFAULT, locale.getName(), nullptr, 0, nullptr, 0, &status); + UDateFormatHolder formatHolder(pFormat, status); if (U_FAILURE(status)) { return status; } - int32_t count = 0; - const UnicodeString* tempStr = dateFormatSymbols->getAmPmStrings(count); - int offset = am ? 0 : 1; - if (offset >= count) - { - return U_INTERNAL_PROGRAM_ERROR; - } + udat_getSymbols(pFormat, UDAT_AM_PMS, am ? 0 : 1, value, valueLength, &status); - tempStr[offset].extract(value, valueLength, status); return status; } |