From 0258f98d4b6bc495493a1dd12f26922d5edd7349 Mon Sep 17 00:00:00 2001 From: treectrl Date: Wed, 1 Jan 2003 21:54:11 +0000 Subject: Fix for 'marquee identify' not reporting column when item has no columns. --- generic/tkTreeItem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generic/tkTreeItem.c b/generic/tkTreeItem.c index a7b7475..83b548b 100644 --- a/generic/tkTreeItem.c +++ b/generic/tkTreeItem.c @@ -3857,7 +3857,7 @@ void TreeItem_Identify2(TreeCtrl *tree, TreeItem item_, totalWidth = 0; treeColumn = tree->columns; column = self->columns; - while (column != NULL) + while (treeColumn != NULL) { if (!TreeColumn_Visible(treeColumn)) columnWidth = 0; @@ -3876,7 +3876,7 @@ void TreeItem_Identify2(TreeCtrl *tree, TreeItem item_, Tcl_Obj *subListObj = Tcl_NewListObj(0, NULL); Tcl_ListObjAppendElement(tree->interp, subListObj, Tcl_NewIntObj(TreeColumn_Index(treeColumn))); - if (column->style != NULL) + if ((column != NULL) && (column->style != NULL)) { drawArgs.style = column->style; drawArgs.x = x + totalWidth + indent; @@ -3891,7 +3891,8 @@ void TreeItem_Identify2(TreeCtrl *tree, TreeItem item_, totalWidth += columnWidth; } treeColumn = TreeColumn_Next(treeColumn); - column = column->next; + if (column != NULL) + column = column->next; } } -- cgit v0.12