summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-11-10 11:38:29 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-11-10 11:38:29 (GMT)
commitedc304c9592d5d5d530ad08c033006e7ce1c38f1 (patch)
tree517a8bbdaa7cc28359b34c040456cec897ee44cd
parent1acbd7884a685ddd69efcf085700c36f2192bc95 (diff)
downloadtk-edc304c9592d5d5d530ad08c033006e7ce1c38f1.zip
tk-edc304c9592d5d5d530ad08c033006e7ce1c38f1.tar.gz
tk-edc304c9592d5d5d530ad08c033006e7ce1c38f1.tar.bz2
Fixes of other issues raised in [Bug 1353022]
-rw-r--r--ChangeLog4
-rw-r--r--generic/tkBind.c6
-rw-r--r--generic/tkTextWind.c3
-rw-r--r--win/tkWinMenu.c12
4 files changed, 17 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 950754d..3250e04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2005-11-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * generic/tkBind.c (ChangeScreen): More DString fixes from
+ * generic/tkTextWind.c (EmbWinLayoutProc): [Bug 1353022]
+ * win/tkWinMenu.c (SetDefaults):
+
* win/tkWinDialog.c (ConvertExternalFilename): Factored out the
encoding conversion and de-backslash-ing code that is used in many
places in this file.
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 235a0fa..44f5949 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkBind.c,v 1.37 2005/11/04 11:52:50 dkf Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.38 2005/11/10 11:38:29 dkf Exp $
*/
#include "tkPort.h"
@@ -2691,7 +2691,9 @@ ChangeScreen(
Tcl_DStringAppend(&cmd, dispName, -1);
sprintf(screen, ".%d", screenIndex);
Tcl_DStringAppend(&cmd, screen, -1);
- code = Tcl_GlobalEval(interp, Tcl_DStringValue(&cmd));
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), Tcl_DStringLength(&cmd),
+ TCL_EVAL_GLOBAL);
+ Tcl_DStringFree(&cmd);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (changing screen in event binding)");
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index 07c4a26..73ea3a8 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextWind.c,v 1.15 2005/10/10 10:36:35 vincentdarley Exp $
+ * RCS: @(#) $Id: tkTextWind.c,v 1.16 2005/11/10 11:38:29 dkf Exp $
*/
#include "tk.h"
@@ -926,6 +926,7 @@ EmbWinLayoutProc(textPtr, indexPtr, ewPtr, offset, maxX, maxChars,
Tcl_ResetResult(textPtr->interp);
ewPtr->body.ew.tkwin = Tk_NameToWindow(textPtr->interp,
Tcl_DStringValue(&name), textPtr->tkwin);
+ Tcl_DStringFree(&name);
if (ewPtr->body.ew.tkwin == NULL) {
goto createError;
}
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 0234f5a..fd3592b 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.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: tkWinMenu.c,v 1.45 2005/08/10 22:02:22 dkf Exp $
+ * RCS: @(#) $Id: tkWinMenu.c,v 1.46 2005/11/10 11:38:29 dkf Exp $
*/
#define OEMRESOURCE
@@ -3017,7 +3017,6 @@ SetDefaults(
char sizeString[TCL_INTEGER_SPACE];
char faceName[LF_FACESIZE];
HDC scratchDC;
- Tcl_DString boldItalicDString;
int bold = 0;
int italic = 0;
TEXTMETRIC tm;
@@ -3066,16 +3065,19 @@ SetDefaults(
sprintf(sizeString, "%d", pointSize);
Tcl_DStringAppendElement(&menuFontDString, sizeString);
- if (bold == 1 || italic == 1) {
+ if (bold || italic) {
+ Tcl_DString boldItalicDString;
+
Tcl_DStringInit(&boldItalicDString);
- if (bold == 1) {
+ if (bold) {
Tcl_DStringAppendElement(&boldItalicDString, "bold");
}
- if (italic == 1) {
+ if (italic) {
Tcl_DStringAppendElement(&boldItalicDString, "italic");
}
Tcl_DStringAppendElement(&menuFontDString,
Tcl_DStringValue(&boldItalicDString));
+ Tcl_DStringFree(&boldItalicDString);
}
/*