ICU-4228 Return an empty locale on error instead of the default locale.
X-SVN-Rev: 16874
This commit is contained in:
parent
3c5cd056bd
commit
fb771e59da
@ -899,7 +899,7 @@ RuleBasedNumberFormat::getNumberOfRuleSetDisplayNameLocales(void) const {
|
|||||||
Locale
|
Locale
|
||||||
RuleBasedNumberFormat::getRuleSetDisplayNameLocale(int32_t index, UErrorCode& status) const {
|
RuleBasedNumberFormat::getRuleSetDisplayNameLocale(int32_t index, UErrorCode& status) const {
|
||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
return Locale();
|
return Locale("");
|
||||||
}
|
}
|
||||||
if (localizations && index >= 0 && index < localizations->getNumberOfDisplayLocales()) {
|
if (localizations && index >= 0 && index < localizations->getNumberOfDisplayLocales()) {
|
||||||
UnicodeString name(TRUE, localizations->getLocaleName(index), -1);
|
UnicodeString name(TRUE, localizations->getLocaleName(index), -1);
|
||||||
@ -910,7 +910,7 @@ RuleBasedNumberFormat::getRuleSetDisplayNameLocale(int32_t index, UErrorCode& st
|
|||||||
bp = (char *)uprv_malloc(cap);
|
bp = (char *)uprv_malloc(cap);
|
||||||
if (bp == NULL) {
|
if (bp == NULL) {
|
||||||
status = U_MEMORY_ALLOCATION_ERROR;
|
status = U_MEMORY_ALLOCATION_ERROR;
|
||||||
return Locale();
|
return Locale("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
name.extract(0, name.length(), bp, cap, UnicodeString::kInvariant);
|
name.extract(0, name.length(), bp, cap, UnicodeString::kInvariant);
|
||||||
|
Loading…
Reference in New Issue
Block a user