use U_INDEX_OUTOFBOUNDS_ERROR where appropriate

X-SVN-Rev: 24
This commit is contained in:
Markus Scherer 1999-10-08 18:54:22 +00:00
parent 7d249a8db3
commit e3d9744240

View file

@ -110,12 +110,12 @@ ubidi_setLine(const UBiDi *pParaBiDi,
/* check the argument values */
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
return;
} else if(pParaBiDi==NULL ||
start<0 || start>limit || limit>pParaBiDi->length ||
pLineBiDi==NULL
) {
} else if(pParaBiDi==NULL || pLineBiDi==NULL) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return;
} else if(start<0 || start>limit || limit>pParaBiDi->length) {
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return;
}
/* set the values in pLineBiDi from its pParaBiDi parent */
@ -826,9 +826,12 @@ CAPI UTextOffset U_EXPORT2
ubidi_getVisualIndex(UBiDi *pBiDi, UTextOffset logicalIndex, UErrorCode *pErrorCode) {
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
return 0;
} else if(pBiDi==NULL || logicalIndex<0 || pBiDi->length<=logicalIndex) {
} else if(pBiDi==NULL) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
} else if(logicalIndex<0 || pBiDi->length<=logicalIndex) {
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
} else {
/* we can do the trivial cases without the runs array */
switch(pBiDi->direction) {
@ -868,9 +871,12 @@ CAPI UTextOffset U_EXPORT2
ubidi_getLogicalIndex(UBiDi *pBiDi, UTextOffset visualIndex, UErrorCode *pErrorCode) {
if(pErrorCode==NULL || FAILURE(*pErrorCode)) {
return 0;
} else if(pBiDi==NULL || visualIndex<0 || pBiDi->length<=visualIndex) {
} else if(pBiDi==NULL) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
} else if(visualIndex<0 || pBiDi->length<=visualIndex) {
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
} else {
/* we can do the trivial cases without the runs array */
switch(pBiDi->direction) {