diff options
author | stanton <stanton@noemail.net> | 1999-06-03 18:50:45 (GMT) |
---|---|---|
committer | stanton <stanton@noemail.net> | 1999-06-03 18:50:45 (GMT) |
commit | 8eae3d2cb4de2a508477318dceb14148ff1f7b42 (patch) | |
tree | 3d3a9cd37eb4ab2165e0e578e370bd471b1ee333 /unix/tkUnixSelect.c | |
parent | e4132baee154ae1a7b7e202afd5cdfa21779ebed (diff) | |
download | tk-8eae3d2cb4de2a508477318dceb14148ff1f7b42.zip tk-8eae3d2cb4de2a508477318dceb14148ff1f7b42.tar.gz tk-8eae3d2cb4de2a508477318dceb14148ff1f7b42.tar.bz2 |
* unix/tkUnixSelect.c:
* tests/unixSelect.test:
* generic/tkSelect.c: Fixed selection code to handle Unicode data
in COMPOUND_TEXT and STRING selections. [Bug: 1791]
FossilOrigin-Name: 0b25ecf24d82bddbf8ea891086f2b369146793db
Diffstat (limited to 'unix/tkUnixSelect.c')
-rw-r--r-- | unix/tkUnixSelect.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c index c94c0be..e3d6b56 100644 --- a/unix/tkUnixSelect.c +++ b/unix/tkUnixSelect.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixSelect.c,v 1.5 1999/06/01 18:51:20 stanton Exp $ + * RCS: @(#) $Id: tkUnixSelect.c,v 1.6 1999/06/03 18:50:46 stanton Exp $ */ #include "tkInt.h" @@ -24,7 +24,7 @@ typedef struct ConvertInfo { * offset of the next chunk of data to * transfer. */ Tcl_EncodingState state; /* The encoding state needed across chunks. */ - char buffer[TCL_UTF_MAX+1]; /* A buffer to hold part of a UTF character + char buffer[TCL_UTF_MAX]; /* A buffer to hold part of a UTF character * that is split across chunks.*/ } ConvertInfo; @@ -322,6 +322,7 @@ TkSelPropProc(eventPtr) */ numItems = 0; + length = 0; } else { TkSelInProgress ip; ip.selPtr = selPtr; @@ -424,6 +425,10 @@ TkSelPropProc(eventPtr) } Tcl_DStringSetLength(&ds, soFar); + if (encoding) { + Tcl_FreeEncoding(encoding); + } + /* * Set the property to the encoded string value. */ @@ -484,7 +489,12 @@ TkSelPropProc(eventPtr) incrPtr->converts[i].offset = -2; } } else { - incrPtr->converts[i].offset += numItems; + /* + * Advance over the selection data that was consumed + * this time. + */ + + incrPtr->converts[i].offset += numItems - length; } return; } |