diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-19 16:31:21 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-19 16:31:21 (GMT) |
commit | 7ee3cf1eefe8f83ea1e5a48fd3b8c0d01803f3b9 (patch) | |
tree | 9cabc949cdcf731cfdfb80d5a7554dded03e004c /win | |
parent | 5d3696a737a0d6cbfc1c3eda16547cff2f9078d7 (diff) | |
download | tk-7ee3cf1eefe8f83ea1e5a48fd3b8c0d01803f3b9.zip tk-7ee3cf1eefe8f83ea1e5a48fd3b8c0d01803f3b9.tar.gz tk-7ee3cf1eefe8f83ea1e5a48fd3b8c0d01803f3b9.tar.bz2 |
More use of Tcl_WinTCharToUtf() in stead of Tcl_UniCharToUtfDString(), making Tk less sensitive to the value of TCL_UTF_MAX (either 3, 4, or 6)
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinClipboard.c | 8 | ||||
-rw-r--r-- | win/tkWinKey.c | 2 | ||||
-rw-r--r-- | win/tkWinMenu.c | 4 |
3 files changed, 5 insertions, 9 deletions
diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 877eed4..93c5d42 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -79,9 +79,7 @@ TkSelGetSelection( goto error; } data = GlobalLock(handle); - Tcl_DStringInit(&ds); - Tcl_UniCharToUtfDString((Tcl_UniChar *)data, - Tcl_UniCharLen((Tcl_UniChar *)data), &ds); + Tcl_WinTCharToUtf((TCHAR *)data, -1, &ds); GlobalUnlock(handle); } else if (IsClipboardFormatAvailable(CF_TEXT)) { /* @@ -157,9 +155,7 @@ TkSelGetSelection( if (count) { Tcl_DStringAppend(&ds, "\n", 1); } - len = Tcl_UniCharLen((Tcl_UniChar *) fname); - Tcl_DStringInit(&dsTmp); - Tcl_UniCharToUtfDString((Tcl_UniChar *) fname, len, &dsTmp); + Tcl_WinTCharToUtf(fname, -1, &dsTmp); Tcl_DStringAppend(&ds, Tcl_DStringValue(&dsTmp), Tcl_DStringLength(&dsTmp)); Tcl_DStringFree(&dsTmp); diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 357a804..8db34af 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -122,7 +122,7 @@ TkpGetString( if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) || (keysym == XK_Return) || (keysym == XK_Tab)) { - len = Tcl_UniCharToUtf((Tcl_UniChar) (keysym & 255), buf); + len = Tcl_UniCharToUtf(keysym & 255, buf); Tcl_DStringAppend(dsPtr, buf, len); } } diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 7a2924d..3223759 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -1250,7 +1250,7 @@ TkWinHandleMenuEvent( int i, len, underline; Tcl_Obj *labelPtr; WCHAR *wlabel; - Tcl_UniChar menuChar; + int menuChar; Tcl_DString ds; *plResult = 0; @@ -1259,7 +1259,7 @@ TkWinHandleMenuEvent( * Assume we have something directly convertable to Tcl_UniChar. * True at least for wide systems. */ - menuChar = Tcl_UniCharToUpper((Tcl_UniChar) LOWORD(*pwParam)); + menuChar = Tcl_UniCharToUpper(LOWORD(*pwParam)); Tcl_DStringInit(&ds); for (i = 0; i < menuPtr->numEntries; i++) { |