diff options
author | uid38226 <uid38226> | 2002-01-31 21:08:19 (GMT) |
---|---|---|
committer | uid38226 <uid38226> | 2002-01-31 21:08:19 (GMT) |
commit | 10c2a9e25a9240aa0788309c55bce42e67c59ca6 (patch) | |
tree | b83f69dfb65bc4a5d3fa12ca5de8a22236d5918d | |
parent | 6657ca47c35d6a7bfe5a649f802af2e272054b1b (diff) | |
download | tk-10c2a9e25a9240aa0788309c55bce42e67c59ca6.zip tk-10c2a9e25a9240aa0788309c55bce42e67c59ca6.tar.gz tk-10c2a9e25a9240aa0788309c55bce42e67c59ca6.tar.bz2 |
Correct and test for logic error when cloning menus. Bug 508988
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tkMenu.c | 4 | ||||
-rw-r--r-- | tests/menu.test | 21 |
3 files changed, 27 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2002-01-31 Todd Helfter <tmh@users.sourceforge.net> + * generic/tkMenu.c (ConfigureMenuCloneEntries) + * tests/menu.test (menu3.68) + Correct and test for logic error when cloning menus. [Bug 508988] + 2002-01-04 Don Porter <dgp@users.sourceforge.net> * generic/tkBind.c (TkBindFree): diff --git a/generic/tkMenu.c b/generic/tkMenu.c index bb845d5..54dec2d 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.6.2.3 2001/09/14 20:39:23 andreas_kupries Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.6.2.4 2002/01/31 21:08:19 uid38226 Exp $ */ /* @@ -1984,7 +1984,7 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv) oldCascadeName = Tcl_GetStringFromObj(oldCascadePtr, NULL); cascadeEntryChanged = (strcmp(oldCascadeName, newCascadeName) - == 0); + != 0); } if (oldCascadePtr != NULL) { Tcl_DecrRefCount(oldCascadePtr); diff --git a/tests/menu.test b/tests/menu.test index 5bd20d1..addeec3 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -5,7 +5,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: menu.test,v 1.3.12.2 2001/04/04 07:57:17 hobbs Exp $ +# RCS: @(#) $Id: menu.test,v 1.3.12.3 2002/01/31 21:08:19 uid38226 Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { source [file join [pwd] [file dirname [info script]] defs.tcl] @@ -911,6 +911,25 @@ test menu-3.67 {MenuWidgetCmd procedure, bad option} { menu .m1 list [catch {.m1 foo} msg] $msg [destroy .m1] } {1 {bad option "foo": must be activate, add, cget, clone, configure, delete, entrycget, entryconfigure, index, insert, invoke, post, postcascade, type, unpost, or yposition} {}} +test menu-3.68 {MenuWidgetCmd procedure, fix for bug#508988} { + set t .t + set m1 .t.m1 + set c1 .t.c1 + set c2 .t.c2 + toplevel $t + menu $m1 -tearoff 1 + menu $c1 -tearoff 1 + $c1 add command -label c1 + menu $c2 -tearoff 1 + $c2 add command -label c2 + $m1 add cascade -label c1 -menu $c1 + $t configure -menu $m1 + $m1 entryconfigure 1 -menu $c2 -label c2 + $t configure -menu "" + set l [list [winfo exists $c1] [winfo exists $c2]] + destroy $t; + set l; +} {1 1} test menu-4.1 {TkInvokeMenu: disabled} { catch {destroy .m1} |