summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-31 15:36:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-31 15:36:56 (GMT)
commitf2b5a87d6dc6d3468828d48929583d950690a40b (patch)
tree22ec58572e255d6081163199ca2f2d60365c7b6c /generic/tkTextDisp.c
parentb68e469c6fcec04a86935ae2e8853197213f40db (diff)
downloadtk-f2b5a87d6dc6d3468828d48929583d950690a40b.zip
tk-f2b5a87d6dc6d3468828d48929583d950690a40b.tar.gz
tk-f2b5a87d6dc6d3468828d48929583d950690a40b.tar.bz2
As requested by Christian Werner/François Vogel and others: Undo many None -> 0 changes, in order to reduce the probability of merge conflicts with other branches.
Remark: Many usages of "None" in Tk are wrong, "NULL" should be used in many places where pointers are referenced in stead of XID's. Those places are corrected.
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index cc304de..904fa1a 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -632,7 +632,7 @@ TkTextCreateDInfo(
dInfoPtr = (TextDInfo *) 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);
@@ -696,19 +696,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, (ClientData) 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;
@@ -827,70 +827,70 @@ 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;
}
- if ((tagPtr->fgColor) && (tagPtr->priority > fgPrio)) {
+ if ((tagPtr->fgColor != None) && (tagPtr->priority > fgPrio)) {
styleValues.fgColor = tagPtr->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;
}
- if ((tagPtr->offsetString)
+ if ((tagPtr->offsetString != NULL)
&& (tagPtr->priority > offsetPrio)) {
styleValues.offset = tagPtr->offset;
offsetPrio = tagPtr->priority;
}
- if ((tagPtr->overstrikeString)
+ if ((tagPtr->overstrikeString != NULL)
&& (tagPtr->priority > overstrikePrio)) {
styleValues.overstrike = tagPtr->overstrike;
overstrikePrio = tagPtr->priority;
}
- if ((tagPtr->rMarginString)
+ if ((tagPtr->rMarginString != NULL)
&& (tagPtr->priority > rMarginPrio)) {
styleValues.rMargin = tagPtr->rMargin;
rMarginPrio = tagPtr->priority;
}
- if ((tagPtr->spacing1String)
+ if ((tagPtr->spacing1String != NULL)
&& (tagPtr->priority > spacing1Prio)) {
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;
@@ -900,12 +900,12 @@ 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;
}
- if ((tagPtr->elideString)
+ if ((tagPtr->elideString != NULL)
&& (tagPtr->priority > elidePrio)) {
styleValues.elide = tagPtr->elide;
elidePrio = tagPtr->priority;
@@ -916,7 +916,7 @@ GetStyle(
wrapPrio = tagPtr->priority;
}
}
- if (tagPtrs) {
+ if (tagPtrs != NULL) {
ckfree((char *) tagPtrs);
}
@@ -941,20 +941,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;
@@ -994,10 +994,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);
}
Tcl_DeleteHashEntry(stylePtr->hPtr);
@@ -2578,7 +2578,7 @@ DisplayLineBackground(
if ((chunkPtr->nextPtr == NULL) && (rightX < maxX)) {
rightX = maxX;
}
- if (chunkPtr->stylePtr->bgGC) {
+ if (chunkPtr->stylePtr->bgGC != None) {
/*
* Not visible - bail out now.
*/
@@ -4335,7 +4335,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);
}
}
@@ -4970,7 +4970,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;
@@ -7708,7 +7708,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;