ICU-329 Clear the parseErr struct consistently by setting the offsets and line with -1
X-SVN-Rev: 6922
This commit is contained in:
parent
ed179d925f
commit
189e70e306
@ -233,7 +233,7 @@ ChoiceFormat::applyPattern(const UnicodeString& pattern,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Clear error struct
|
// Clear error struct
|
||||||
parseError.offset = 0;
|
parseError.offset = -1;
|
||||||
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
||||||
|
|
||||||
// Perform 2 passes. The first computes the number of limits in
|
// Perform 2 passes. The first computes the number of limits in
|
||||||
|
@ -2290,7 +2290,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Clear error struct
|
// Clear error struct
|
||||||
parseError.offset = 0;
|
parseError.offset = -1;
|
||||||
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
||||||
|
|
||||||
// Set the significant pattern symbols
|
// Set the significant pattern symbols
|
||||||
|
@ -403,7 +403,7 @@ MessageFormat::applyPattern(const UnicodeString& newPattern,
|
|||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
fMaxOffset = -1;
|
fMaxOffset = -1;
|
||||||
// Clear error struct
|
// Clear error struct
|
||||||
parseError.offset = 0;
|
parseError.offset = -1;
|
||||||
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
||||||
int32_t patLen = newPattern.length();
|
int32_t patLen = newPattern.length();
|
||||||
for (; i < patLen; ++i) {
|
for (; i < patLen; ++i) {
|
||||||
|
@ -743,7 +743,7 @@ TransliterationRuleData* TransliteratorParser::orphanData() {
|
|||||||
void TransliteratorParser::parseRules(const UnicodeString& rules,
|
void TransliteratorParser::parseRules(const UnicodeString& rules,
|
||||||
UTransDirection theDirection) {
|
UTransDirection theDirection) {
|
||||||
// Clear error struct
|
// Clear error struct
|
||||||
parseError.line = parseError.offset = 0;
|
parseError.line = parseError.offset = -1;
|
||||||
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
|
||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
|
|
||||||
|
@ -154,8 +154,7 @@ static void maskingError(const U_NAMESPACE_QUALIFIER TransliterationRule& rule1,
|
|||||||
U_NAMESPACE_QUALIFIER UnicodeString r;
|
U_NAMESPACE_QUALIFIER UnicodeString r;
|
||||||
int32_t len;
|
int32_t len;
|
||||||
|
|
||||||
parseError.line = 0;
|
parseError.line = parseError.offset = -1;
|
||||||
parseError.offset = 0;
|
|
||||||
|
|
||||||
// for pre-context
|
// for pre-context
|
||||||
rule1.toRule(r, FALSE);
|
rule1.toRule(r, FALSE);
|
||||||
|
@ -1174,7 +1174,8 @@ Transliterator* Transliterator::parseID(const UnicodeString& ID,
|
|||||||
if (registry == 0) {
|
if (registry == 0) {
|
||||||
initializeRegistry();
|
initializeRegistry();
|
||||||
}
|
}
|
||||||
parseError.line = parseError.offset = 0;
|
/* clear the error struct */
|
||||||
|
parseError.line = parseError.offset = -1;
|
||||||
parseError.preContext[0] = parseError.postContext[0] = 0;
|
parseError.preContext[0] = parseError.postContext[0] = 0;
|
||||||
TransliteratorAlias* alias = 0;
|
TransliteratorAlias* alias = 0;
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user