ICU-4228 Return an empty locale on error instead of the default locale.

X-SVN-Rev: 16874
This commit is contained in:
George Rhoten 2004-11-16 22:42:08 +00:00
parent 3c5cd056bd
commit fb771e59da

View File

@ -899,7 +899,7 @@ RuleBasedNumberFormat::getNumberOfRuleSetDisplayNameLocales(void) const {
Locale
RuleBasedNumberFormat::getRuleSetDisplayNameLocale(int32_t index, UErrorCode& status) const {
if (U_FAILURE(status)) {
return Locale();
return Locale("");
}
if (localizations && index >= 0 && index < localizations->getNumberOfDisplayLocales()) {
UnicodeString name(TRUE, localizations->getLocaleName(index), -1);
@ -910,7 +910,7 @@ RuleBasedNumberFormat::getRuleSetDisplayNameLocale(int32_t index, UErrorCode& st
bp = (char *)uprv_malloc(cap);
if (bp == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
return Locale();
return Locale("");
}
}
name.extract(0, name.length(), bp, cap, UnicodeString::kInvariant);