[ion/unicode] Define and use CodePoint const methods

isLowerCaseLetter
isUpperCaseLetter
isLetter
isDigit

Remove similar ones from UTF8Helper and from Poincare::Tokenizer.
This commit is contained in:
Ruben Dashyan
2020-01-24 14:30:42 +01:00
committed by Léa Saviot
parent 7665ad6fe0
commit 9b0b4e3096
7 changed files with 26 additions and 45 deletions

View File

@@ -414,7 +414,7 @@ bool PythonToolbox::handleEvent(Ion::Events::Event event) {
}
if (event.hasText() && strlen(event.text()) == 1 ) {
char c = event.text()[0];
if (UTF8Helper::CodePointIsLetter(c)) {
if (CodePoint(c).isLetter()) {
scrollToLetter(c);
return true;
}
@@ -475,7 +475,7 @@ int PythonToolbox::maxNumberOfDisplayedRows() {
}
void PythonToolbox::scrollToLetter(char letter) {
assert(UTF8Helper::CodePointIsLetter(letter));
assert(CodePoint(letter).isLetter());
/* We look for a child MessageTree that starts with the wanted letter. If we
* do not find one, we scroll to the first child MessageTree that starts with
* a letter higher than the wanted letter. */
@@ -487,7 +487,7 @@ void PythonToolbox::scrollToLetter(char letter) {
index = i;
break;
}
if (index < 0 && l >= lowerLetter && UTF8Helper::CodePointIsLowerCaseLetter(l)) {
if (index < 0 && l >= lowerLetter && CodePoint(l).isLowerCaseLetter()) {
index = i;
}
}