diff options
author | treectrl <treectrl> | 2006-12-06 23:56:14 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2006-12-06 23:56:14 (GMT) |
commit | 7f43bf86be233d0c7691f3ffee540e024d66ff11 (patch) | |
tree | 37da783aa150b39d8acb75cfab2be7e0f9b017ea /generic/tkTreeDisplay.c | |
parent | 0b6bab94778b41c392b11e471cd757958b9abbab (diff) | |
download | tktreectrl-7f43bf86be233d0c7691f3ffee540e024d66ff11.zip tktreectrl-7f43bf86be233d0c7691f3ffee540e024d66ff11.tar.gz tktreectrl-7f43bf86be233d0c7691f3ffee540e024d66ff11.tar.bz2 |
Fixed a crash when invalidating a column of an item if the column wasn't the first in a span.
Diffstat (limited to 'generic/tkTreeDisplay.c')
-rw-r--r-- | generic/tkTreeDisplay.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/generic/tkTreeDisplay.c b/generic/tkTreeDisplay.c index 3e1150b..9b37443 100644 --- a/generic/tkTreeDisplay.c +++ b/generic/tkTreeDisplay.c @@ -5,7 +5,7 @@ * * Copyright (c) 2002-2006 Tim Baker * - * RCS: @(#) $Id: tkTreeDisplay.c,v 1.74 2006/12/06 00:52:04 treectrl Exp $ + * RCS: @(#) $Id: tkTreeDisplay.c,v 1.75 2006/12/06 23:56:14 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -6687,18 +6687,31 @@ Tree_InvalidateItemDInfo( columnIndex = TreeColumn_Index(column); left = dColumn->offset; + /* If only one column is visible, the width may be + * different than the column width. */ + if ((TreeColumn_Lock(column) == COLUMN_LOCK_NONE) && + (tree->columnCountVis == 1)) { + width = area->width; + + /* All spans are 1. */ + } else if (dItem->spans == NULL) { + width = dColumn->width; + + /* If the column being redrawn is not the first in the span, + * then do nothing. */ + } else if (columnIndex != dItem->spans[columnIndex]) { + goto next; + /* Calculate the width of the entire span. */ /* Do NOT call TreeColumn_UseWidth() or another routine * that calls Tree_WidthOfColumns() because that may end * up recalculating the size of items whose display info * is currently being invalidated. */ - if (dItem->spans == NULL) { - width = dColumn->width; } else { width = 0; column2 = column; - i = dItem->spans[columnIndex]; - while (dItem->spans[i] == dItem->spans[columnIndex]) { + i = columnIndex; + while (dItem->spans[i] == columnIndex) { width += TreeColumn_GetDInfo(column2)->width; if (++i == tree->columnCount) break; @@ -6706,12 +6719,6 @@ Tree_InvalidateItemDInfo( } } - /* If only one column is visible, the width may be - * different than the column width. */ - if (TreeColumn_Lock(column) == COLUMN_LOCK_NONE) - if (tree->columnCountVis == 1) - width = area->width; - if (width > 0) { InvalidateDItemX(dItem, area, 0, left, width); InvalidateDItemY(dItem, area, 0, 0, dItem->height); |