restore QChar::isLetterOrNumber() and QChar::isSpace() behaviour to that prior to fa34c080f6

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-12-13 21:18:55 +00:00
parent 805b9678d4
commit 96899c184d

View file

@ -612,6 +612,16 @@ bool QChar::isSpace() const
{
if(ucs >= 9 && ucs <= 13)
return true;
const int8_t category = u_charType(ucs);
switch (category) {
case U_SPACE_SEPARATOR:
case U_LINE_SEPARATOR:
case U_PARAGRAPH_SEPARATOR:
return true;
default:
return false;
}
// special characters check
return u_isblank(ucs);
}
@ -676,7 +686,21 @@ bool QChar::isLetterOrNumber() const
if (is_ascii_char(ucs)) {
return is_ascii_letterornumber(ucs);
}
return u_isalnum(ucs);
const int8_t category = u_charType(ucs);
switch (category) {
case U_UPPERCASE_LETTER:
case U_LOWERCASE_LETTER:
case U_TITLECASE_LETTER:
case U_MODIFIER_LETTER:
case U_OTHER_LETTER:
case U_DECIMAL_DIGIT_NUMBER:
case U_LETTER_NUMBER:
case U_OTHER_NUMBER:
return true;
default:
return false;
}
return false;
}