ICU-176 numDisplayCells() UTF-16 enabled

X-SVN-Rev: 1081
This commit is contained in:
Markus Scherer 2000-04-06 16:47:20 +00:00
parent e542c7dedc
commit 0399573487

View file

@ -336,12 +336,12 @@ UnicodeString::numDisplayCells( UTextOffset start,
// pin indices to legal values
pinIndices(start, length);
UChar c;
UChar32 c;
int32_t result = 0;
UTextOffset limit = start + length;
while(start < limit) {
c = getArrayStart()[start];
UTF_NEXT_CHAR(fArray, start, limit, c);
switch(Unicode::getCellWidth(c)) {
case Unicode::ZERO_WIDTH:
break;;
@ -358,7 +358,6 @@ UnicodeString::numDisplayCells( UTextOffset start,
result += (asian ? 2 : 1);
break;
}
++start;
}
return result;