summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-09-20 22:59:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-09-20 22:59:40 (GMT)
commit468499bdecc1465a84240284ade36429012147e8 (patch)
treec03418956b7682e229796f5a2de8d36f866b4b8f /generic/tkTextDisp.c
parente00b3f658a46280b2a4e638171b8d64100182385 (diff)
downloadtk-468499bdecc1465a84240284ade36429012147e8.zip
tk-468499bdecc1465a84240284ade36429012147e8.tar.gz
tk-468499bdecc1465a84240284ade36429012147e8.tar.bz2
Only call callbacks that are not NULL. [Bug 1791052]
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index d5d827d..7e43bf1 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextDisp.c,v 1.65 2007/09/07 00:34:54 dgp Exp $
+ * RCS: @(#) $Id: tkTextDisp.c,v 1.66 2007/09/20 22:59:40 dkf Exp $
*/
#include "tkInt.h"
@@ -1551,6 +1551,7 @@ LayoutDLine(
*/
TkTextLine *linePtr = TkBTreeNextLine(NULL, curIndex.linePtr);
+
if (linePtr != NULL) {
dlPtr->logicalLinesMerged++;
curIndex.byteIndex = 0;
@@ -1609,11 +1610,15 @@ LayoutDLine(
}
FreeStyle(textPtr, chunkPtr->stylePtr);
breakChunkPtr->nextPtr = chunkPtr->nextPtr;
- (*chunkPtr->undisplayProc)(textPtr, chunkPtr);
+ if (chunkPtr->undisplayProc != NULL) {
+ (*chunkPtr->undisplayProc)(textPtr, chunkPtr);
+ }
ckfree((char *) chunkPtr);
}
if (breakByteOffset != breakChunkPtr->numBytes) {
- (*breakChunkPtr->undisplayProc)(textPtr, breakChunkPtr);
+ if (breakChunkPtr->undisplayProc != NULL) {
+ (*breakChunkPtr->undisplayProc)(textPtr, breakChunkPtr);
+ }
segPtr = TkTextIndexToSeg(&breakIndex, &byteOffset);
(*segPtr->typePtr->layoutProc)(textPtr, &breakIndex,
segPtr, byteOffset, maxX, breakByteOffset, 0,