summaryrefslogtreecommitdiffstats
path: root/generic/tkConfig.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-14 17:56:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-14 17:56:43 (GMT)
commit9cc0c1a8843006e8e8fcf3f42086104b8e3f0292 (patch)
tree4ef08e3ec72473580173788dd1d3f3d66eb52739 /generic/tkConfig.c
parentf9747c69e2da6a3ba02d3ce2f2c81710243bec1c (diff)
downloadtk-9cc0c1a8843006e8e8fcf3f42086104b8e3f0292.zip
tk-9cc0c1a8843006e8e8fcf3f42086104b8e3f0292.tar.gz
tk-9cc0c1a8843006e8e8fcf3f42086104b8e3f0292.tar.bz2
Fix for TIP #613: In case of TK_XXXX_NULL handling for relief/justify/anchor, don't create a "" object but just use NULL (as other options do)
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r--generic/tkConfig.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 496869a..17a3c28 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -2114,7 +2114,9 @@ GetObjectForOption(
break;
}
case TK_OPTION_RELIEF:
- objPtr = Tcl_NewStringObj(Tk_NameOfRelief(*((int *)internalPtr)), TCL_INDEX_NONE);
+ if (*((int *)internalPtr) != TK_RELIEF_NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOfRelief(*((int *)internalPtr)), TCL_INDEX_NONE);
+ }
break;
case TK_OPTION_CURSOR: {
Tk_Cursor cursor = *((Tk_Cursor *)internalPtr);
@@ -2126,12 +2128,16 @@ GetObjectForOption(
break;
}
case TK_OPTION_JUSTIFY:
- objPtr = Tcl_NewStringObj(Tk_NameOfJustify(
- *((Tk_Justify *)internalPtr)), TCL_INDEX_NONE);
+ if (*((Tk_Justify *)internalPtr) != TK_JUSTIFY_NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOfJustify(
+ *((Tk_Justify *)internalPtr)), TCL_INDEX_NONE);
+ }
break;
case TK_OPTION_ANCHOR:
- objPtr = Tcl_NewStringObj(Tk_NameOfAnchor(
- *((Tk_Anchor *)internalPtr)), TCL_INDEX_NONE);
+ if (*((Tk_Anchor *)internalPtr) != TK_ANCHOR_NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOfAnchor(
+ *((Tk_Anchor *)internalPtr)), TCL_INDEX_NONE);
+ }
break;
case TK_OPTION_PIXELS:
if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK)) || *((int *) internalPtr) != INT_MIN) {