summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index a6ee33e..7e1a88e 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -664,7 +664,7 @@ TkTextCreateDInfo(
dInfoPtr = ckalloc(sizeof(TextDInfo));
Tcl_InitHashTable(&dInfoPtr->styleTable, sizeof(StyleValues)/sizeof(int));
dInfoPtr->dLinePtr = NULL;
- dInfoPtr->copyGC = 0;
+ dInfoPtr->copyGC = NULL;
gcValues.graphics_exposures = True;
dInfoPtr->scrollGC = Tk_GetGC(textPtr->tkwin, GCGraphicsExposures,
&gcValues);
@@ -728,19 +728,19 @@ TkTextFreeDInfo(
FreeDLines(textPtr, dInfoPtr->dLinePtr, NULL, DLINE_UNLINK);
Tcl_DeleteHashTable(&dInfoPtr->styleTable);
- if (dInfoPtr->copyGC) {
+ if (dInfoPtr->copyGC != None) {
Tk_FreeGC(textPtr->display, dInfoPtr->copyGC);
}
Tk_FreeGC(textPtr->display, dInfoPtr->scrollGC);
if (dInfoPtr->flags & REDRAW_PENDING) {
Tcl_CancelIdleCall(DisplayText, textPtr);
}
- if (dInfoPtr->lineUpdateTimer) {
+ if (dInfoPtr->lineUpdateTimer != NULL) {
Tcl_DeleteTimerHandler(dInfoPtr->lineUpdateTimer);
textPtr->refCount--;
dInfoPtr->lineUpdateTimer = NULL;
}
- if (dInfoPtr->scrollbarTimer) {
+ if (dInfoPtr->scrollbarTimer != NULL) {
Tcl_DeleteTimerHandler(dInfoPtr->scrollbarTimer);
textPtr->refCount--;
dInfoPtr->scrollbarTimer = NULL;
@@ -882,7 +882,7 @@ GetStyle(
styleValues.relief = tagPtr->relief;
reliefPrio = tagPtr->priority;
}
- if ((tagPtr->bgStipple)
+ if ((tagPtr->bgStipple != None)
&& (tagPtr->priority > bgStipplePrio)) {
styleValues.bgStipple = tagPtr->bgStipple;
bgStipplePrio = tagPtr->priority;
@@ -891,26 +891,26 @@ GetStyle(
styleValues.fgColor = fgColor;
fgPrio = tagPtr->priority;
}
- if ((tagPtr->tkfont) && (tagPtr->priority > fontPrio)) {
+ if ((tagPtr->tkfont != None) && (tagPtr->priority > fontPrio)) {
styleValues.tkfont = tagPtr->tkfont;
fontPrio = tagPtr->priority;
}
- if ((tagPtr->fgStipple)
+ if ((tagPtr->fgStipple != None)
&& (tagPtr->priority > fgStipplePrio)) {
styleValues.fgStipple = tagPtr->fgStipple;
fgStipplePrio = tagPtr->priority;
}
- if ((tagPtr->justifyString)
+ if ((tagPtr->justifyString != NULL)
&& (tagPtr->priority > justifyPrio)) {
styleValues.justify = tagPtr->justify;
justifyPrio = tagPtr->priority;
}
- if ((tagPtr->lMargin1String)
+ if ((tagPtr->lMargin1String != NULL)
&& (tagPtr->priority > lMargin1Prio)) {
styleValues.lMargin1 = tagPtr->lMargin1;
lMargin1Prio = tagPtr->priority;
}
- if ((tagPtr->lMargin2String)
+ if ((tagPtr->lMargin2String != NULL)
&& (tagPtr->priority > lMargin2Prio)) {
styleValues.lMargin2 = tagPtr->lMargin2;
lMargin2Prio = tagPtr->priority;
@@ -925,7 +925,7 @@ GetStyle(
styleValues.offset = tagPtr->offset;
offsetPrio = tagPtr->priority;
}
- if ((tagPtr->overstrikeString)
+ if ((tagPtr->overstrikeString != NULL)
&& (tagPtr->priority > overstrikePrio)) {
styleValues.overstrike = tagPtr->overstrike;
overstrikePrio = tagPtr->priority;
@@ -935,7 +935,7 @@ GetStyle(
styleValues.overstrikeColor = fgColor;
}
}
- if ((tagPtr->rMarginString)
+ if ((tagPtr->rMarginString != NULL)
&& (tagPtr->priority > rMarginPrio)) {
styleValues.rMargin = tagPtr->rMargin;
rMarginPrio = tagPtr->priority;
@@ -950,17 +950,17 @@ GetStyle(
styleValues.spacing1 = tagPtr->spacing1;
spacing1Prio = tagPtr->priority;
}
- if ((tagPtr->spacing2String)
+ if ((tagPtr->spacing2String != NULL)
&& (tagPtr->priority > spacing2Prio)) {
styleValues.spacing2 = tagPtr->spacing2;
spacing2Prio = tagPtr->priority;
}
- if ((tagPtr->spacing3String)
+ if ((tagPtr->spacing3String != NULL)
&& (tagPtr->priority > spacing3Prio)) {
styleValues.spacing3 = tagPtr->spacing3;
spacing3Prio = tagPtr->priority;
}
- if ((tagPtr->tabStringPtr)
+ if ((tagPtr->tabStringPtr != NULL)
&& (tagPtr->priority > tabPrio)) {
styleValues.tabArrayPtr = tagPtr->tabArrayPtr;
tabPrio = tagPtr->priority;
@@ -970,7 +970,7 @@ GetStyle(
styleValues.tabStyle = tagPtr->tabStyle;
tabStylePrio = tagPtr->priority;
}
- if ((tagPtr->underlineString)
+ if ((tagPtr->underlineString != NULL)
&& (tagPtr->priority > underlinePrio)) {
styleValues.underline = tagPtr->underline;
underlinePrio = tagPtr->priority;
@@ -980,7 +980,7 @@ GetStyle(
styleValues.underlineColor = fgColor;
}
}
- if ((tagPtr->elideString)
+ if ((tagPtr->elideString != NULL)
&& (tagPtr->priority > elidePrio)) {
styleValues.elide = tagPtr->elide;
elidePrio = tagPtr->priority;
@@ -991,7 +991,7 @@ GetStyle(
wrapPrio = tagPtr->priority;
}
}
- if (tagPtrs) {
+ if (tagPtrs != NULL) {
ckfree(tagPtrs);
}
@@ -1016,20 +1016,20 @@ GetStyle(
if (styleValues.border != NULL) {
gcValues.foreground = Tk_3DBorderColor(styleValues.border)->pixel;
mask = GCForeground;
- if (styleValues.bgStipple) {
+ if (styleValues.bgStipple != None) {
gcValues.stipple = styleValues.bgStipple;
gcValues.fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
}
stylePtr->bgGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues);
} else {
- stylePtr->bgGC = 0;
+ stylePtr->bgGC = NULL;
}
mask = GCFont;
gcValues.font = Tk_FontId(styleValues.tkfont);
mask |= GCForeground;
gcValues.foreground = styleValues.fgColor->pixel;
- if (styleValues.fgStipple) {
+ if (styleValues.fgStipple != None) {
gcValues.stipple = styleValues.fgStipple;
gcValues.fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
@@ -1074,10 +1074,10 @@ FreeStyle(
{
stylePtr->refCount--;
if (stylePtr->refCount == 0) {
- if (stylePtr->bgGC) {
+ if (stylePtr->bgGC != None) {
Tk_FreeGC(textPtr->display, stylePtr->bgGC);
}
- if (stylePtr->fgGC) {
+ if (stylePtr->fgGC != None) {
Tk_FreeGC(textPtr->display, stylePtr->fgGC);
}
if (stylePtr->ulGC) {
@@ -2688,7 +2688,7 @@ DisplayLineBackground(
if ((chunkPtr->nextPtr == NULL) && (rightX < maxX)) {
rightX = maxX;
}
- if (chunkPtr->stylePtr->bgGC) {
+ if (chunkPtr->stylePtr->bgGC != None) {
/*
* Not visible - bail out now.
*/
@@ -4544,7 +4544,7 @@ DisplayText(
dlPtr->spaceAbove,
dlPtr->height-dlPtr->spaceAbove-dlPtr->spaceBelow,
dlPtr->baseline - dlPtr->spaceAbove, NULL,
- 0, dlPtr->y + dlPtr->spaceAbove);
+ (Drawable) None, dlPtr->y + dlPtr->spaceAbove);
}
}
}
@@ -5180,7 +5180,7 @@ TkTextRelayoutWindow(
gcValues.graphics_exposures = False;
newGC = Tk_GetGC(textPtr->tkwin, GCGraphicsExposures, &gcValues);
- if (dInfoPtr->copyGC) {
+ if (dInfoPtr->copyGC != None) {
Tk_FreeGC(textPtr->display, dInfoPtr->copyGC);
}
dInfoPtr->copyGC = newGC;
@@ -7994,7 +7994,7 @@ CharDisplayProc(
*/
if (!sValuePtr->elide && (numBytes > offsetBytes)
- && stylePtr->fgGC) {
+ && (stylePtr->fgGC != None)) {
#if TK_DRAW_IN_CONTEXT
int start = ciPtr->baseOffset + offsetBytes;
int len = ciPtr->numBytes - offsetBytes;