зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a3410a7eb3
Коммит
1e66d08774
|
@ -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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче