summaryrefslogtreecommitdiffstats
path: root/generic/tkTextBTree.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-01-07 16:28:23 (GMT)
committervincentdarley <vincentdarley>2004-01-07 16:28:23 (GMT)
commit46eead19d1ac38c3bcc59c7b24ab3a621b29eb3b (patch)
tree182b6e90e0039b2a56b8eff89176999a750beb26 /generic/tkTextBTree.c
parent635a8263e2a11333a1940f788b530eaeeda89275 (diff)
downloadtk-46eead19d1ac38c3bcc59c7b24ab3a621b29eb3b.zip
tk-46eead19d1ac38c3bcc59c7b24ab3a621b29eb3b.tar.gz
tk-46eead19d1ac38c3bcc59c7b24ab3a621b29eb3b.tar.bz2
fix to text widget yview bug
Diffstat (limited to 'generic/tkTextBTree.c')
-rw-r--r--generic/tkTextBTree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index b2db5aa..8ac05ea 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextBTree.c,v 1.11 2003/12/15 11:51:06 vincentdarley Exp $
+ * RCS: @(#) $Id: tkTextBTree.c,v 1.12 2004/01/07 16:28:23 vincentdarley Exp $
*/
#include "tkInt.h"
@@ -1002,6 +1002,10 @@ TkBTreeFindPixelLine(tree, pixels, pixelOffset)
return NULL;
}
+ if (nodePtr->numPixels == 0) {
+ panic("TkBTreeFindPixelLine called with empty window");
+ }
+
/*
* Work down through levels of the tree until a node is found at
* level 0.
@@ -1012,7 +1016,7 @@ TkBTreeFindPixelLine(tree, pixels, pixelOffset)
nodePtr->numPixels <= pixelsLeft;
nodePtr = nodePtr->nextPtr) {
if (nodePtr == NULL) {
- panic("TkBTreeFindLine ran out of nodes");
+ panic("TkBTreeFindPixelLine ran out of nodes");
}
pixelsLeft -= nodePtr->numPixels;
}
@@ -1026,7 +1030,7 @@ TkBTreeFindPixelLine(tree, pixels, pixelOffset)
linePtr->pixelHeight < pixelsLeft;
linePtr = linePtr->nextPtr) {
if (linePtr == NULL) {
- panic("TkBTreeFindLine ran out of lines");
+ panic("TkBTreeFindPixelLine ran out of lines");
}
pixelsLeft -= linePtr->pixelHeight;
}