summaryrefslogtreecommitdiffstats
path: root/generic/tkTreeStyle.c
diff options
context:
space:
mode:
authortreectrl <treectrl>2002-12-28 21:50:01 (GMT)
committertreectrl <treectrl>2002-12-28 21:50:01 (GMT)
commitfa736db3f0a4c99718862e8e7939d9a84d0c1d87 (patch)
treec25518576ef6a1e538ff60c41a25f9acbe21b942 /generic/tkTreeStyle.c
parent3fa72bfc3cafdca44872181b39dd3823cd6d0bb8 (diff)
downloadtktreectrl-fa736db3f0a4c99718862e8e7939d9a84d0c1d87.zip
tktreectrl-fa736db3f0a4c99718862e8e7939d9a84d0c1d87.tar.gz
tktreectrl-fa736db3f0a4c99718862e8e7939d9a84d0c1d87.tar.bz2
Return error when illegal chars specified in -expand, -iexpand and -squeeze.
Diffstat (limited to 'generic/tkTreeStyle.c')
-rw-r--r--generic/tkTreeStyle.c47
1 files changed, 37 insertions, 10 deletions
diff --git a/generic/tkTreeStyle.c b/generic/tkTreeStyle.c
index 7a785b6..4e3566f 100644
--- a/generic/tkTreeStyle.c
+++ b/generic/tkTreeStyle.c
@@ -2935,10 +2935,19 @@ static int StyleLayoutCmd(ClientData clientData, Tcl_Interp *interp, int objc,
{
switch (expand[k])
{
- case 'w': eLink->flags |= ELF_eEXPAND_W; break;
- case 'n': eLink->flags |= ELF_eEXPAND_N; break;
- case 'e': eLink->flags |= ELF_eEXPAND_E; break;
- case 's': eLink->flags |= ELF_eEXPAND_S; break;
+ case 'w': case 'W': eLink->flags |= ELF_eEXPAND_W; break;
+ case 'n': case 'N': eLink->flags |= ELF_eEXPAND_N; break;
+ case 'e': case 'E': eLink->flags |= ELF_eEXPAND_E; break;
+ case 's': case 'S': eLink->flags |= ELF_eEXPAND_S; break;
+ default:
+ {
+ Tcl_ResetResult(tree->interp);
+ Tcl_AppendResult(tree->interp, "bad expand value \"",
+ expand, "\": must be a string ",
+ "containing zero or more of n, e, s, and w",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
}
}
break;
@@ -2953,10 +2962,19 @@ static int StyleLayoutCmd(ClientData clientData, Tcl_Interp *interp, int objc,
{
switch (expand[k])
{
- case 'w': eLink->flags |= ELF_iEXPAND_W; break;
- case 'n': eLink->flags |= ELF_iEXPAND_N; break;
- case 'e': eLink->flags |= ELF_iEXPAND_E; break;
- case 's': eLink->flags |= ELF_iEXPAND_S; break;
+ case 'w': case 'W': eLink->flags |= ELF_iEXPAND_W; break;
+ case 'n': case 'N': eLink->flags |= ELF_iEXPAND_N; break;
+ case 'e': case 'E': eLink->flags |= ELF_iEXPAND_E; break;
+ case 's': case 'S': eLink->flags |= ELF_iEXPAND_S; break;
+ default:
+ {
+ Tcl_ResetResult(tree->interp);
+ Tcl_AppendResult(tree->interp, "bad iexpand value \"",
+ expand, "\": must be a string ",
+ "containing zero or more of n, e, s, and w",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
}
}
break;
@@ -2971,8 +2989,17 @@ static int StyleLayoutCmd(ClientData clientData, Tcl_Interp *interp, int objc,
{
switch (string[k])
{
- case 'x': eLink->flags |= ELF_SQUEEZE_X; break;
- case 'y': eLink->flags |= ELF_SQUEEZE_Y; break;
+ case 'x': case 'X': eLink->flags |= ELF_SQUEEZE_X; break;
+ case 'y': case 'Y': eLink->flags |= ELF_SQUEEZE_Y; break;
+ default:
+ {
+ Tcl_ResetResult(tree->interp);
+ Tcl_AppendResult(tree->interp, "bad squeeze value \"",
+ string, "\": must be a string ",
+ "containing zero or more of x and y",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
}
}
break;