Tk Source Code

Check-in [7262cbf0]
Login

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

Overview
Comment:[Bug 3291543] There was a crash if dchars removed all coordinates of a polygon.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 7262cbf02c025fff0a5274b344e35ac0e335242f
User & Date: pspjuth 2011-04-22 18:21:05
Context
2011-04-30
22:28
[Bug 2949774]: cascade menus should popdown ofter loosing the pointer.

When the pointer moves to another entry from a cascade entry the sub-menu should popdown. This is how other menus on X11 work today. This effect will not be used if the user has configured ClickToFocus to maintain the previous Tk menu effects.

(backported from trunk)

Signed-off-by: Pat Thoyts <[email protected]> check-in: 27b9615d user: patthoyts tags: core-8-5-branch

2011-04-22
18:24
[Bug 3291543] There was a crash if dchars removed all coordinates of a polygon. check-in: 5df336a5 user: pspjuth tags: trunk
18:21
[Bug 3291543] There was a crash if dchars removed all coordinates of a polygon. check-in: 7262cbf0 user: pspjuth tags: core-8-5-branch
18:17
[Bug 3291543] There was a crash if dchars removed all coordinates of a polygon. check-in: 22a6a821 user: pspjuth tags: core-8-4-branch
2011-04-21
22:56
eliminate unneeded variable displayFocusPtr check-in: 659cc90e user: jan tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2011-04-21  Peter Spjuth  <[email protected]>

	* doc/checkbutton.n: Document all variable options as global.
	* doc/radiobutton.n:
	* doc/listbox.n:
	* doc/menu.n:
	* doc/options.n:
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2011-04-22  Peter Spjuth  <[email protected]>

	* generic/tkCanvPoly.c: [Bug 3291543] There was a crash if dchars
	* tests/canvas.test:    removed all coordinates of a polygon.

2011-04-21  Peter Spjuth  <[email protected]>

	* doc/checkbutton.n: Document all variable options as global.
	* doc/radiobutton.n:
	* doc/listbox.n:
	* doc/menu.n:
	* doc/options.n:

Changes to generic/tkCanvPoly.c.

1196
1197
1198
1199
1200
1201
1202

1203
1204
1205
1206
1207
1208
1209
	count += length;
    }

    if (count >= length) {
	polyPtr->numPoints = 0;
	if (polyPtr->coordPtr != NULL) {
	    ckfree((char *) polyPtr->coordPtr);

	}
	ComputePolygonBbox(canvas, polyPtr);
	return;
    }

    if (last>=first) {
	for(i=last+2; i<length; i++) {







>







1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
	count += length;
    }

    if (count >= length) {
	polyPtr->numPoints = 0;
	if (polyPtr->coordPtr != NULL) {
	    ckfree((char *) polyPtr->coordPtr);
	    polyPtr->coordPtr = NULL;
	}
	ComputePolygonBbox(canvas, polyPtr);
	return;
    }

    if (last>=first) {
	for(i=last+2; i<length; i++) {

Changes to tests/canvas.test.

401
402
403
404
405
406
407








408
409
410
411
412
413
414
    lappend result [.c find over 60 40 60 40]; # top-center point
    lappend result [.c find over 0 0 0 0]; # not on poly
    lappend result [.c find over 60 60 60 60]; # center-point
    lappend result [.c find over 45 50 45 50]; # outside poly
    .c itemconfig 1 -width 8
    lappend result [.c find over 45 50 45 50]; # outside poly
} -result {1 1 {} 1 {} 1 1 {} 1 {} 1}









test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} -setup {
    destroy .c
    pack [canvas .c]
} -body {
    set qx [expr {1.+1.}] 
    # qx has type double and no string representation 







>
>
>
>
>
>
>
>







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
    lappend result [.c find over 60 40 60 40]; # top-center point
    lappend result [.c find over 0 0 0 0]; # not on poly
    lappend result [.c find over 60 60 60 60]; # center-point
    lappend result [.c find over 45 50 45 50]; # outside poly
    .c itemconfig 1 -width 8
    lappend result [.c find over 45 50 45 50]; # outside poly
} -result {1 1 {} 1 {} 1 1 {} 1 {} 1}
test canvas-11.3 {canvas poly dchars, bug 3291543} {
    # This would crash
    destroy .c
    pack [canvas .c]
    .c create polygon 0 0 0 10 10 0
    .c dchars 1 2 end
    .c coords 1
} {}

test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} -setup {
    destroy .c
    pack [canvas .c]
} -body {
    set qx [expr {1.+1.}] 
    # qx has type double and no string representation