diff options
author | vincentdarley <vincentdarley> | 2003-12-15 11:51:00 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2003-12-15 11:51:00 (GMT) |
commit | 6b97ba2c3cc4da8e29a95fc694baea3b57cf8018 (patch) | |
tree | 14cd813c65ebd93c03478077ca270e6f1623d234 /generic/tkTextBTree.c | |
parent | 652fc56a55bca6e89050af3ef1fc758070a43b0e (diff) | |
download | tk-6b97ba2c3cc4da8e29a95fc694baea3b57cf8018.zip tk-6b97ba2c3cc4da8e29a95fc694baea3b57cf8018.tar.gz tk-6b97ba2c3cc4da8e29a95fc694baea3b57cf8018.tar.bz2 |
text widget more extensive documentation, and two small code improvements
Diffstat (limited to 'generic/tkTextBTree.c')
-rw-r--r-- | generic/tkTextBTree.c | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 22d91c7..b2db5aa 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.10 2003/11/08 17:22:46 vincentdarley Exp $ + * RCS: @(#) $Id: tkTextBTree.c,v 1.11 2003/12/15 11:51:06 vincentdarley Exp $ */ #include "tkInt.h" @@ -55,7 +55,9 @@ typedef struct Node { int numChildren; /* Number of children of this node. */ int numLines; /* Total number of lines (leaves) in * the subtree rooted here. */ - int numPixels; + int numPixels; /* Total number of vertical + * display pixels in the + * subtree rooted here. */ } Node; /* @@ -2837,13 +2839,14 @@ TkTextIsElided(textPtr, indexPtr, elideInfo) } } - if (LOTSA_TAGS < infoPtr->numTags) { - ckfree((char *) infoPtr->tagCnts); - ckfree((char *) infoPtr->tagPtrs); - } elide = infoPtr->elide; - + if (elideInfo == NULL) { + if (LOTSA_TAGS < infoPtr->numTags) { + ckfree((char *) infoPtr->tagCnts); + ckfree((char *) infoPtr->tagPtrs); + } + ckfree((char*) infoPtr); } @@ -2853,6 +2856,34 @@ TkTextIsElided(textPtr, indexPtr, elideInfo) /* *---------------------------------------------------------------------- * + * TkTextFreeElideInfo -- + * + * This is a utility procedure used to free up any memory + * allocated by the TkTextIsElided function above. + * + * Results: + * None. + * + * Side effects: + * Memory may be freed. + * + *---------------------------------------------------------------------- + */ + +void +TkTextFreeElideInfo(elideInfo) + TkTextElideInfo *elideInfo; /* Free any allocated memory in this + * structure. */ +{ + if (LOTSA_TAGS < elideInfo->numTags) { + ckfree((char*)elideInfo->tagCnts); + ckfree((char*)elideInfo->tagPtrs); + } +} + +/* + *---------------------------------------------------------------------- + * * IncCount -- * * This is a utility procedure used by TkBTreeGetTags. It |