summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-15 08:40:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-15 08:40:43 (GMT)
commitf48cf633835522b4ffc3c1483cfcfdaae6b2ab24 (patch)
tree0797b1a4258f1f65dd3ccbcf24f995d1d997917b /generic/tkText.c
parentcbda117030f9eeabbdbcb5bdcb56295243864dad (diff)
parent1498eb2e29305e7d3ab57d7dc2464c699be08589 (diff)
downloadtk-f48cf633835522b4ffc3c1483cfcfdaae6b2ab24.zip
tk-f48cf633835522b4ffc3c1483cfcfdaae6b2ab24.tar.gz
tk-f48cf633835522b4ffc3c1483cfcfdaae6b2ab24.tar.bz2
Complete fix for [53fdb87e49]: "Glyph indexing is still unperfect". Tk 8.7 now uses UTF-32 indices everywhere, just as Tk 9.0.
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 8e6c9c1..b186e18 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -1461,7 +1461,7 @@ TextWidgetObjCmd(
insertLength = 0;
for (j = 4; j < objc; j += 2) {
- insertLength += Tcl_GetCharLength(objv[j]);
+ insertLength += TkGetCharLength(objv[j]);
}
/*
@@ -4092,12 +4092,12 @@ TextSearchIndexInLine(
if (searchSpecPtr->exact) {
index += leftToScan;
} else {
- index += Tcl_NumUtfChars(segPtr->body.chars, leftToScan);
+ index += TkNumUtfChars(segPtr->body.chars, leftToScan);
}
} else if (searchSpecPtr->exact) {
index += segPtr->size;
} else {
- index += Tcl_NumUtfChars(segPtr->body.chars, -1);
+ index += TkNumUtfChars(segPtr->body.chars, -1);
}
}
leftToScan -= segPtr->size;
@@ -4222,7 +4222,7 @@ TextSearchAddNextLine(
Tcl_GetString(theLine);
*lenPtr = theLine->length;
} else {
- *lenPtr = Tcl_GetCharLength(theLine);
+ *lenPtr = TkGetCharLength(theLine);
}
}
return linePtr;
@@ -4292,7 +4292,7 @@ TextSearchFoundMatch(
if (searchSpecPtr->exact) {
const char *startOfLine = Tcl_GetString(theLine);
- numChars = Tcl_NumUtfChars(startOfLine + matchOffset, matchLength);
+ numChars = TkNumUtfChars(startOfLine + matchOffset, matchLength);
} else {
numChars = matchLength;
}
@@ -4351,13 +4351,13 @@ TextSearchFoundMatch(
if (searchSpecPtr->exact) {
matchOffset += segPtr->size;
} else {
- matchOffset += Tcl_NumUtfChars(segPtr->body.chars, -1);
+ matchOffset += TkNumUtfChars(segPtr->body.chars, -1);
}
} else {
if (searchSpecPtr->exact) {
leftToScan -= (int)segPtr->size;
} else {
- leftToScan -= Tcl_NumUtfChars(segPtr->body.chars, -1);
+ leftToScan -= TkNumUtfChars(segPtr->body.chars, -1);
}
}
curIndex.byteIndex += segPtr->size;
@@ -4442,13 +4442,13 @@ TextSearchFoundMatch(
continue;
} else if (!searchSpecPtr->searchElide
&& TkTextIsElided(textPtr, &curIndex, NULL)) {
- numChars += Tcl_NumUtfChars(segPtr->body.chars, -1);
+ numChars += TkNumUtfChars(segPtr->body.chars, -1);
continue;
}
if (searchSpecPtr->exact) {
leftToScan -= segPtr->size;
} else {
- leftToScan -= Tcl_NumUtfChars(segPtr->body.chars, -1);
+ leftToScan -= TkNumUtfChars(segPtr->body.chars, -1);
}
}