Bug 1418477 - Part 1. Should check error status of unum_open. r=jfkthame

We don't check error of unum_open, so we should check it.  Because
unum_setAttribute doesn't have UErrorCode parameter.

MozReview-Commit-ID: 3j7jeiKbdG

--HG--
extra : rebase_source : 61d0daf8f14f1a36623967d9d63648a8a88e25ae
This commit is contained in:
Makoto Kato 2017-11-22 11:57:53 +09:00
Родитель a3410a7eb3
Коммит 1e66d08774
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -100,6 +100,12 @@ ICUUtils::LocalizeNumber(double aValue,
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
AutoCloseUNumberFormat format(unum_open(UNUM_DECIMAL, nullptr, 0, AutoCloseUNumberFormat format(unum_open(UNUM_DECIMAL, nullptr, 0,
langTag.get(), nullptr, &status)); langTag.get(), nullptr, &status));
// Since unum_setAttribute have no UErrorCode parameter, we have to
// check error status.
if (U_FAILURE(status)) {
aLangTags.GetNext(langTag);
continue;
}
unum_setAttribute(format, UNUM_GROUPING_USED, unum_setAttribute(format, UNUM_GROUPING_USED,
LocaleNumberGroupingIsEnabled()); LocaleNumberGroupingIsEnabled());
// ICU default is a maximum of 3 significant fractional digits. We don't // ICU default is a maximum of 3 significant fractional digits. We don't