summaryrefslogtreecommitdiffstats
path: root/generic/tkTreeDisplay.c
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-11-27 19:16:10 (GMT)
committertreectrl <treectrl>2006-11-27 19:16:10 (GMT)
commit122faf94880ff4751e845ca4adabb4a3c6646ce2 (patch)
tree6e3af8eabcc6a7ac6047144c3b8db882aa563f2c /generic/tkTreeDisplay.c
parent84be4c2283676e15822d2616226731fa0e57829b (diff)
downloadtktreectrl-122faf94880ff4751e845ca4adabb4a3c6646ce2.zip
tktreectrl-122faf94880ff4751e845ca4adabb4a3c6646ce2.tar.gz
tktreectrl-122faf94880ff4751e845ca4adabb4a3c6646ce2.tar.bz2
Merge with VERSION2_2fixes.
Diffstat (limited to 'generic/tkTreeDisplay.c')
-rw-r--r--generic/tkTreeDisplay.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tkTreeDisplay.c b/generic/tkTreeDisplay.c
index e4fd557..ab45395 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.66 2006/11/27 02:05:18 treectrl Exp $
+ * RCS: @(#) $Id: tkTreeDisplay.c,v 1.67 2006/11/27 19:16:10 treectrl Exp $
*/
#include "tkTreeCtrl.h"
@@ -1248,7 +1248,7 @@ RangesToIncrementsX(
int totalWidth = Tree_TotalWidth(tree);
int size;
- if (dInfo->rangeFirst == NULL)
+ if (totalWidth <= visWidth)
return;
/* First increment is zero */
@@ -1256,10 +1256,12 @@ RangesToIncrementsX(
dInfo->xScrollIncrements = (int *) ckalloc(size * sizeof(int));
dInfo->xScrollIncrements[dInfo->xScrollIncrementCount++] = 0;
- range = dInfo->rangeFirst->next;
- while (range != NULL) {
- size = Increment_AddX(tree, range->offset, size);
- range = range->next;
+ if (dInfo->rangeFirst != NULL) {
+ range = dInfo->rangeFirst->next;
+ while (range != NULL) {
+ size = Increment_AddX(tree, range->offset, size);
+ range = range->next;
+ }
}
if ((visWidth > 1) && (totalWidth -
dInfo->xScrollIncrements[dInfo->xScrollIncrementCount - 1] > visWidth)) {