diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-14 08:32:07 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-14 08:32:07 (GMT) |
commit | fa083c8aaf7ff3d22de606e25adb0b598dba0dd6 (patch) | |
tree | 51134cd671ebf8759cc2b4ff148cd7d9d3797725 /generic/tkCanvText.c | |
parent | 6eb17d212faf798cf9cd89c85467d8f8893ca614 (diff) | |
download | tk-fa083c8aaf7ff3d22de606e25adb0b598dba0dd6.zip tk-fa083c8aaf7ff3d22de606e25adb0b598dba0dd6.tar.gz tk-fa083c8aaf7ff3d22de606e25adb0b598dba0dd6.tar.bz2 |
Better approach, using "Tk" prefix for UTF-32 versions of API
Diffstat (limited to 'generic/tkCanvText.c')
-rw-r--r-- | generic/tkCanvText.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index 8e85946..3f02158 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -594,7 +594,7 @@ ConfigureText( */ textPtr->numBytes = strlen(textPtr->text); - textPtr->numChars = Tcl_NumUtfChars(textPtr->text, textPtr->numBytes); + textPtr->numChars = TkNumUtfChars(textPtr->text, textPtr->numBytes); if (textInfoPtr->selItemPtr == itemPtr) { if (textInfoPtr->selectFirst >= textPtr->numChars) { @@ -1119,7 +1119,7 @@ TextInsert( ckfree(text); textPtr->text = newStr; - charsAdded = Tcl_NumUtfChars(string, byteCount); + charsAdded = TkNumUtfChars(string, byteCount); textPtr->numChars += charsAdded; textPtr->numBytes += byteCount; @@ -1189,8 +1189,8 @@ TextDeleteChars( } charsRemoved = last + 1 - first; - byteIndex = Tcl_UtfAtIndex(text, first) - text; - byteCount = Tcl_UtfAtIndex(text + byteIndex, charsRemoved) + byteIndex = TkUtfAtIndex(text, first) - text; + byteCount = TkUtfAtIndex(text + byteIndex, charsRemoved) - (text + byteIndex); newStr = (char *)ckalloc(textPtr->numBytes + 1 - byteCount); @@ -1612,8 +1612,8 @@ GetSelText( return 0; } text = textPtr->text; - selStart = Tcl_UtfAtIndex(text, textInfoPtr->selectFirst); - selEnd = Tcl_UtfAtIndex(selStart, + selStart = TkUtfAtIndex(text, textInfoPtr->selectFirst); + selEnd = TkUtfAtIndex(selStart, textInfoPtr->selectLast + 1 - textInfoPtr->selectFirst); if (selEnd <= selStart + offset) { return 0; |