projects
/
apple
/
icu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ICU-64232.0.1.tar.gz
[apple/icu.git]
/
icuSources
/
i18n
/
fpositer.cpp
diff --git
a/icuSources/i18n/fpositer.cpp
b/icuSources/i18n/fpositer.cpp
index 47d4b3f9b14cf3e1de3e2cb6dcd0fd25e737b2cb..75d529eb8c929fd5544a5f6e092cf30a910fa3a1 100644
(file)
--- a/
icuSources/i18n/fpositer.cpp
+++ b/
icuSources/i18n/fpositer.cpp
@@
-65,10
+65,10
@@
void FieldPositionIterator::setData(UVector32 *adopt, UErrorCode& status) {
if (adopt->size() == 0) {
delete adopt;
adopt = NULL;
if (adopt->size() == 0) {
delete adopt;
adopt = NULL;
- } else if ((adopt->size() %
3
) != 0) {
+ } else if ((adopt->size() %
4
) != 0) {
status = U_ILLEGAL_ARGUMENT_ERROR;
} else {
status = U_ILLEGAL_ARGUMENT_ERROR;
} else {
- for (int i =
1; i < adopt->size(); i += 3
) {
+ for (int i =
2; i < adopt->size(); i += 4
) {
if (adopt->elementAti(i) >= adopt->elementAti(i+1)) {
status = U_ILLEGAL_ARGUMENT_ERROR;
break;
if (adopt->elementAti(i) >= adopt->elementAti(i+1)) {
status = U_ILLEGAL_ARGUMENT_ERROR;
break;
@@
-95,6
+95,8
@@
UBool FieldPositionIterator::next(FieldPosition& fp) {
return FALSE;
}
return FALSE;
}
+ // Ignore the first element of the tetrad: used for field category
+ pos++;
fp.setField(data->elementAti(pos++));
fp.setBeginIndex(data->elementAti(pos++));
fp.setEndIndex(data->elementAti(pos++));
fp.setField(data->elementAti(pos++));
fp.setBeginIndex(data->elementAti(pos++));
fp.setEndIndex(data->elementAti(pos++));