Updated previous iterator for Thai collation.

X-SVN-Rev: 3996
This commit is contained in:
Syn Wee Quek 2001-03-09 18:25:30 +00:00
parent d5816e0c3e
commit d4ebc2590d
2 changed files with 28 additions and 12 deletions

View File

@ -277,9 +277,16 @@ struct incrementalContext {
if (ch <= 0xFF) { \
(order) = (coll)->latinOneMapping[ch]; \
} \
else { \
(order) = ucmp32_get((coll)->mapping, ch); \
} \
else \
if ((data).isThai && UCOL_ISTHAIBASECONSONANT(ch) && \
((data).pos) != (data).string && \
((data).pos) != (data).writableBuffer && \
UCOL_ISTHAIPREVOWEL(*((data).pos -1))) { \
result = UCOL_THAI; \
} \
else { \
(result) = ucmp32_get((coll)->mapping, ch); \
} \
if ((order) >= UCOL_NOT_FOUND) { \
(order) = getSpecialPrevCE((coll), (order), &(data), (length), \
(status)); \

View File

@ -105,10 +105,8 @@ ucol_next(UCollationElements *elems,
}
elems->reset_ = FALSE;
UCOL_GETNEXTCE(result, elems->collator_, elems->iteratordata_, status);
#ifdef UCOL_DEBUG
#ifdef _DEBUG
if ((elems->iteratordata_).CEpos > (elems->iteratordata_).toReturn)
{
result = *((elems->iteratordata_).toReturn++);
@ -135,6 +133,8 @@ ucol_next(UCollationElements *elems,
}
else
(result) = UCOL_NO_MORE_CES;
#else
UCOL_GETNEXTCE(result, elems->collator_, elems->iteratordata_, status);
#endif
if (result == UCOL_NO_MORE_CES) {
@ -160,10 +160,7 @@ ucol_previous(UCollationElements *elems,
elems->reset_ = FALSE;
UCOL_GETPREVCE(result, elems->collator_, elems->iteratordata_,
elems->length_, status);
#ifdef UCOL_DEBUG
#ifdef _DEBUG
const UCollator *coll = elems->collator_;
collIterate *data = &(elems->iteratordata_);
int32_t length = elems->length_;
@ -186,8 +183,17 @@ ucol_previous(UCollationElements *elems,
UChar ch = *(data->pos);
if (ch <= 0xFF)
(result) = (coll)->latinOneMapping[ch];
else
(result) = ucmp32_get((coll)->mapping, ch);
else {
if (data->isThai && UCOL_ISTHAIBASECONSONANT(ch) &&
(data->pos) != data->string &&
(data->pos) != data->writableBuffer &&
UCOL_ISTHAIPREVOWEL(*(data->pos -1))) {
result = UCOL_THAI;
}
else {
(result) = ucmp32_get((coll)->mapping, ch);
}
}
if ((result) >= UCOL_NOT_FOUND)
{
@ -197,6 +203,9 @@ ucol_previous(UCollationElements *elems,
}
}
}
#else
UCOL_GETPREVCE(result, elems->collator_, elems->iteratordata_,
elems->length_, status);
#endif
if (result == UCOL_NO_MORE_CES) {