mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 18:25:57 +00:00
ICU-1499 If I try to get a string on an int resource, return an error.
X-SVN-Rev: 7598
This commit is contained in:
parent
9b2bcc3bd0
commit
b5ff7eab60
1 changed files with 18 additions and 2 deletions
|
@ -940,13 +940,22 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
|
|||
|
||||
if(RES_GET_TYPE(resB->fRes) == RES_TABLE) {
|
||||
int32_t t=0;
|
||||
|
||||
res = res_getTableItemByKey(&(resB->fResData), resB->fRes, &t, &key);
|
||||
|
||||
if(res == RES_BOGUS) {
|
||||
key = inKey;
|
||||
if(resB->fHasFallback == TRUE) {
|
||||
const ResourceData *rd = getFallbackData(resB, &key, &realData, &res, status);
|
||||
if(U_SUCCESS(*status)) {
|
||||
return res_getString(rd, res, len);
|
||||
switch (RES_GET_TYPE(res)) {
|
||||
case RES_STRING:
|
||||
case RES_TABLE:
|
||||
case RES_ARRAY:
|
||||
return res_getString(rd, res, len);
|
||||
default:
|
||||
*status = U_RESOURCE_TYPE_MISMATCH;
|
||||
}
|
||||
} else {
|
||||
*status = U_MISSING_RESOURCE_ERROR;
|
||||
}
|
||||
|
@ -954,7 +963,14 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
|
|||
*status = U_MISSING_RESOURCE_ERROR;
|
||||
}
|
||||
} else {
|
||||
return res_getString(&(resB->fResData), res, len);
|
||||
switch (RES_GET_TYPE(res)) {
|
||||
case RES_STRING:
|
||||
case RES_TABLE:
|
||||
case RES_ARRAY:
|
||||
return res_getString(&(resB->fResData), res, len);
|
||||
default:
|
||||
*status = U_RESOURCE_TYPE_MISMATCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
|
|
Loading…
Add table
Reference in a new issue