Tk Source Code

Check-in [407486bb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[Bug 3588824]: bug in image index handling for weird image names
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-4-branch
Files: files | file ages | folders
SHA1: 407486bba7706acb1788e8372b098fb9dc706b3e
User & Date: fvogel 2012-12-03 01:23:46
Context
2012-12-03
01:24
Fixed commit date check-in: 2f0eb00f user: fvogel tags: core-8-4-branch
01:23
[Bug 3588824]: bug in image index handling for weird image names check-in: 407486bb user: fvogel tags: core-8-4-branch
2012-11-24
08:23
Added tests for weird embedded windows names Closed-Leaf check-in: f5d72ec4 user: fvogel tags: bug-3588824
2012-11-15
19:31
More complete purge of things only present for supporting long-dead Mac 9 systems. check-in: 599ec1e5 user: dgp tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2012-11-13  Jan Nijtmans  <[email protected]>

	* win/tkWinTest.c: [Bug 3585396]: winDialog.test requires user
	* tests/winDialog.test: interaction. Renumber test-cases as in
	Tk 8.6, and convert various to tcltest-2 style.

2012-09-27  Jan Nijtmans  <[email protected]>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-11-??  Francois Vogel  <[email protected]>

   * generic/tkTextIndex.c: [Bug 3588824]: bug in image index handling
   * tests/textIndex.test:  for weird image names

2012-11-13  Jan Nijtmans  <[email protected]>

	* win/tkWinTest.c: [Bug 3585396]: winDialog.test requires user
	* tests/winDialog.test: interaction. Renumber test-cases as in
	Tk 8.6, and convert various to tcltest-2 style.

2012-09-27  Jan Nijtmans  <[email protected]>

Changes to generic/tkTextIndex.c.

324
325
326
327
328
329
330

331
332
333
334
335
336
337
338
339








340
341
342
343
344
345
346
    char c;
    CONST char *cp;
    Tcl_DString copy;

    /*
     *---------------------------------------------------------------------
     * Stage 1: check to see if the index consists of nothing but a mark

     * name.  We do this check now even though it's also done later, in
     * order to allow mark names that include funny characters such as
     * spaces or "+1c".
     *---------------------------------------------------------------------
     */

    if (TkTextMarkNameToIndex(textPtr, string, indexPtr) == TCL_OK) {
	return TCL_OK;
    }









    /*
     *------------------------------------------------
     * Stage 2: start again by parsing the base index.
     *------------------------------------------------
     */








>
|
|
|






>
>
>
>
>
>
>
>







324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
    char c;
    CONST char *cp;
    Tcl_DString copy;

    /*
     *---------------------------------------------------------------------
     * Stage 1: check to see if the index consists of nothing but a mark
     * name, an embedded window or an embedded image.  We do this check
     * now even though it's also done later, in order to allow mark names,
     * embedded window names or image names that include funny characters
     * such as spaces or "+1c".
     *---------------------------------------------------------------------
     */

    if (TkTextMarkNameToIndex(textPtr, string, indexPtr) == TCL_OK) {
	return TCL_OK;
    }

    if (TkTextWindowIndex(textPtr, string, indexPtr) != 0) {
	return TCL_OK;
    }

    if (TkTextImageIndex(textPtr, string, indexPtr) != 0) {
	return TCL_OK;
    }

    /*
     *------------------------------------------------
     * Stage 2: start again by parsing the base index.
     *------------------------------------------------
     */

Changes to tests/textIndex.test.

215
216
217
218
219
220
221





222
223
224

















225
226
227
228
229
230
231
.t tag add x 2.8 2.11
.t tag add x 6.0 6.2
set weirdTag "funny . +- 22.1\n\t{"
.t tag add $weirdTag 2.1  2.6
set weirdMark "asdf \n{-+ 66.2\t"
.t mark set $weirdMark 4.0
.t tag config y -relief raised





test textIndex-3.1 {TkTextGetIndex, weird mark names} {
    list [catch {.t index $weirdMark} msg] $msg
} {0 4.0}


















test textIndex-4.1 {TkTextGetIndex, tags} {
    list [catch {.t index x.first} msg] $msg
} {0 2.8}
test textIndex-4.2 {TkTextGetIndex, tags} {
    list [catch {.t index x.last} msg] $msg
} {0 6.2}







>
>
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
.t tag add x 2.8 2.11
.t tag add x 6.0 6.2
set weirdTag "funny . +- 22.1\n\t{"
.t tag add $weirdTag 2.1  2.6
set weirdMark "asdf \n{-+ 66.2\t"
.t mark set $weirdMark 4.0
.t tag config y -relief raised
set weirdImage "foo-1"
.t image create 2.1 -image [image create photo $weirdImage]
set weirdEmbWin ".t.bar-1"
entry $weirdEmbWin
.t window create 3.1 -window $weirdEmbWin
test textIndex-3.1 {TkTextGetIndex, weird mark names} {
    list [catch {.t index $weirdMark} msg] $msg
} {0 4.0}
test textIndex-3.2 {TkTextGetIndex, weird mark names} knownBug {
    list [catch {.t index "$weirdMark -1char"} msg] $msg
} {0 4.0}
test textIndex-3.3 {TkTextGetIndex, weird embedded window names} {
    list [catch {.t index $weirdEmbWin} msg] $msg
} {0 3.1}
test textIndex-3.4 {TkTextGetIndex, weird embedded window names} knownBug {
    list [catch {.t index "$weirdEmbWin -1char"} msg] $msg
} {0 3.0}
test textIndex-3.5 {TkTextGetIndex, weird image names} {
    list [catch {.t index $weirdImage} msg] $msg
} {0 2.1}
test textIndex-3.6 {TkTextGetIndex, weird image names} knownBug {
    list [catch {.t index "$weirdImage -1char"} msg] $msg
} {0 2.0}
.t delete 3.1  ; # remove the weirdEmbWin
.t delete 2.1  ; # remove the weirdImage

test textIndex-4.1 {TkTextGetIndex, tags} {
    list [catch {.t index x.first} msg] $msg
} {0 2.8}
test textIndex-4.2 {TkTextGetIndex, tags} {
    list [catch {.t index x.last} msg] $msg
} {0 6.2}