diff options
author | das <das> | 2007-10-21 14:50:19 (GMT) |
---|---|---|
committer | das <das> | 2007-10-21 14:50:19 (GMT) |
commit | 1d730cff2145db43adb79ab02e476a974816d9de (patch) | |
tree | ad2d54d94b5afecee2cec450f384a4c09ecb576b | |
parent | 09ba3f901be7659d605d2bf711da4ec6d7b5217f (diff) | |
download | tk-1d730cff2145db43adb79ab02e476a974816d9de.zip tk-1d730cff2145db43adb79ab02e476a974816d9de.tar.gz tk-1d730cff2145db43adb79ab02e476a974816d9de.tar.bz2 |
* generic/tkFont.c (Tk{Create,Delete}NamedFont): allow NULL interp.
-rw-r--r-- | generic/tkFont.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index 2ad6a91..64c487b 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.c,v 1.39 2007/09/07 00:34:52 dgp Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.40 2007/10/21 14:50:19 das Exp $ */ #include "tkInt.h" @@ -944,7 +944,7 @@ RecomputeWidgets( int TkCreateNamedFont( - Tcl_Interp *interp, /* Interp for error return. */ + Tcl_Interp *interp, /* Interp for error return (can be NULL). */ Tk_Window tkwin, /* A window associated with interp. */ const char *name, /* Name for the new named font. */ TkFontAttributes *faPtr) /* Attributes for the new named font. */ @@ -961,9 +961,10 @@ TkCreateNamedFont( if (!isNew) { nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); if (nfPtr->deletePending == 0) { - Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "named font \"", name, - "\" already exists", NULL); + if (interp) { + Tcl_AppendResult(interp, "named font \"", name, + "\" already exists", NULL); + } return TCL_ERROR; } @@ -1001,7 +1002,7 @@ TkCreateNamedFont( int TkDeleteNamedFont( - Tcl_Interp *interp, /* Interp for error return. */ + Tcl_Interp *interp, /* Interp for error return (can be NULL). */ Tk_Window tkwin, /* A window associated with interp. */ CONST char *name) /* Name for the new named font. */ { @@ -1013,8 +1014,10 @@ TkDeleteNamedFont( namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, name); if (namedHashPtr == NULL) { - Tcl_AppendResult(interp, "named font \"", name, - "\" doesn't exist", NULL); + if (interp) { + Tcl_AppendResult(interp, "named font \"", name, + "\" doesn't exist", NULL); + } return TCL_ERROR; } nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); |