From 7d8887a5c1131402a85c7ef45899e28b85561a91 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Mon, 19 Nov 2007 18:49:58 +0000 Subject: Fixed crash bug in style element create --- ChangeLog | 5 +++++ generic/ttk/ttkTheme.c | 4 ++-- tests/ttk/ttk.test | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d420e6d..3667ef6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,11 @@ * changes: Update changes for 8.5b3 release. +2007-11-19 Pat Thoyts + + * generic/ttk/ttkTheme.c: Fixed crash when 'style element create' + * tests/ttk/ttk.test: called with insufficient args. Plus tests. + 2007-11-18 Joe English * generic/ttk/ttkElements.c, macosx/ttkMacOSXTheme.c: Add "fill" diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 74ffcf0..de63d71 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.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. * - * $Id: ttkTheme.c,v 1.7 2007/11/08 01:40:25 jenglish Exp $ + * $Id: ttkTheme.c,v 1.8 2007/11/19 18:49:59 patthoyts Exp $ */ #include @@ -1460,7 +1460,7 @@ static int StyleElementCreateCmd( FactoryRec *recPtr; if (objc < 5) { - Tcl_WrongNumArgs(interp, 5, objv, "name type ?options...?"); + Tcl_WrongNumArgs(interp, 3, objv, "name type ?options...?"); return TCL_ERROR; } diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index 4f91eb0..cd3291b 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -587,6 +587,19 @@ test ttk-14.3 "-textvariable in nonexistant namespace" -body { -match glob -cleanup { destroy .tw } +test ttk-15.1 "style element create: insufficient args" -body { + ttk::style element create +} -returnCodes 1 -match glob -result "wrong # args:*" +test ttk-15.2 "style element create: insufficient args" -body { + ttk::style element create plain.background +} -returnCodes 1 -match glob -result "wrong # args:*" +test ttk-15.3 "style element create: insufficient args" -body { + ttk::style element create plain.background from +} -returnCodes 1 -match glob -result "wrong # args:*" +test ttk-15.4 "style element create: valid" -body { + ttk::style element create plain.background from default +} -returnCodes 0 -result "" + eval destroy [winfo children .] tcltest::cleanupTests -- cgit v0.12