mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-2397 make hasPrevious/hasNext true when throwing away buffered chars from that end
X-SVN-Rev: 11069
This commit is contained in:
parent
0c4249f0b4
commit
41a939315c
1 changed files with 4 additions and 0 deletions
|
@ -202,6 +202,7 @@ readNext(UNormIterator *uni, UCharIterator *iter) {
|
|||
/* move array contents to make room */
|
||||
moveContentsTowardStart(api, uni->chars, uni->states, delta);
|
||||
api->index=limit=api->limit;
|
||||
uni->hasPrevious=TRUE;
|
||||
}
|
||||
|
||||
/* normalize starting from the limit position */
|
||||
|
@ -221,6 +222,7 @@ readNext(UNormIterator *uni, UCharIterator *iter) {
|
|||
/* empty and re-use the arrays */
|
||||
uni->states[0]=uni->states[limit];
|
||||
api->start=api->index=api->limit=limit=0;
|
||||
uni->hasPrevious=TRUE;
|
||||
} else {
|
||||
capacity+=room+100;
|
||||
if(!reallocArrays(uni, capacity, FALSE)) {
|
||||
|
@ -271,6 +273,7 @@ readPrevious(UNormIterator *uni, UCharIterator *iter) {
|
|||
/* move array contents to make room */
|
||||
moveContentsTowardEnd(api, uni->chars, uni->states, delta);
|
||||
api->index=start=api->start;
|
||||
uni->hasNext=TRUE;
|
||||
}
|
||||
|
||||
/* normalize ending at the start position */
|
||||
|
@ -290,6 +293,7 @@ readPrevious(UNormIterator *uni, UCharIterator *iter) {
|
|||
/* empty and re-use the arrays */
|
||||
uni->states[capacity]=uni->states[start];
|
||||
api->start=api->index=api->limit=start=capacity;
|
||||
uni->hasNext=TRUE;
|
||||
} else {
|
||||
capacity+=room+100;
|
||||
if(!reallocArrays(uni, capacity, TRUE)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue