summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkTreeview.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-20 07:49:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-20 07:49:01 (GMT)
commit06b5ea26625d50fb3cf48c115b4efa0115f20d9e (patch)
treea4e36bd46f383213f4d496689d3cb448d2573cda /generic/ttk/ttkTreeview.c
parent08324ade17dc603b75f629ce0f6b78bfa4757517 (diff)
downloadtk-06b5ea26625d50fb3cf48c115b4efa0115f20d9e.zip
tk-06b5ea26625d50fb3cf48c115b4efa0115f20d9e.tar.gz
tk-06b5ea26625d50fb3cf48c115b4efa0115f20d9e.tar.bz2
New macro TkNewIndexObj(), which handled indices >= 2147483648 correctly when compiled against Tcl 9.0 headers.
Diffstat (limited to 'generic/ttk/ttkTreeview.c')
-rw-r--r--generic/ttk/ttkTreeview.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 76a9e6f..33c3466 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -792,9 +792,8 @@ static int PickupSlack(Treeview *tv, int extra)
{
int newSlack = tv->tree.slack + extra;
- if ( (newSlack < 0 && 0 <= tv->tree.slack)
- || (newSlack > 0 && 0 >= tv->tree.slack))
- {
+ if ((newSlack < 0 && 0 <= tv->tree.slack)
+ || (newSlack > 0 && 0 >= tv->tree.slack)) {
tv->tree.slack = 0;
return newSlack;
} else {
@@ -1101,10 +1100,9 @@ TreeviewConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
TtkScrollbarUpdateRequired(tv->tree.xscrollHandle);
TtkScrollbarUpdateRequired(tv->tree.yscrollHandle);
}
- if ( (mask & SHOW_CHANGED)
- && GetEnumSetFromObj(
- interp,tv->tree.showObj,showStrings,&showFlags) != TCL_OK)
- {
+ if ((mask & SHOW_CHANGED)
+ && GetEnumSetFromObj(
+ interp,tv->tree.showObj,showStrings,&showFlags) != TCL_OK) {
return TCL_ERROR;
}
@@ -2109,7 +2107,7 @@ static int TreeviewIndexCommand(
{
Treeview *tv = (Treeview *)recordPtr;
TreeItem *item;
- int index = 0;
+ TkSizeT index = 0;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "item");
@@ -2125,7 +2123,7 @@ static int TreeviewIndexCommand(
item = item->prev;
}
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index));
+ Tcl_SetObjResult(interp, TkNewIndexObj(index));
return TCL_OK;
}
@@ -2201,9 +2199,8 @@ static int TreeviewHorribleIdentify(
/* ASSERT: objc == 4 */
- if ( Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK
- || Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK
- ) {
+ if (Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK
+ || Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) {
return TCL_ERROR;
}
@@ -2750,9 +2747,8 @@ static int TreeviewMoveCommand(
Tcl_WrongNumArgs(interp, 2, objv, "item parent index");
return TCL_ERROR;
}
- if ( (item = FindItem(interp, tv, objv[2])) == 0
- || (parent = FindItem(interp, tv, objv[3])) == 0)
- {
+ if ((item = FindItem(interp, tv, objv[2])) == 0
+ || (parent = FindItem(interp, tv, objv[3])) == 0) {
return TCL_ERROR;
}
@@ -2879,9 +2875,8 @@ static int TreeviewDragCommand(
return TCL_ERROR;
}
- if ( (column = FindColumn(interp, tv, objv[2])) == 0
- || Tcl_GetIntFromObj(interp, objv[3], &newx) != TCL_OK)
- {
+ if ((column = FindColumn(interp, tv, objv[2])) == 0
+ || Tcl_GetIntFromObj(interp, objv[3], &newx) != TCL_OK) {
return TCL_ERROR;
}