summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tkText.c6
-rw-r--r--generic/tkTextDisp.c23
-rw-r--r--generic/tkTextIndex.c4
-rw-r--r--generic/tkTextTag.c11
4 files changed, 27 insertions, 17 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 74f6730..d46c542 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -2284,7 +2284,11 @@ ConfigureText(
|| (textPtr->selTagPtr->spacing2String != NULL)
|| (textPtr->selTagPtr->spacing3String != NULL)
|| (textPtr->selTagPtr->tabStringPtr != NULL)
- || (textPtr->selTagPtr->wrapMode != TEXT_WRAPMODE_NULL)) {
+ || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR)
+ || (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR)
+ || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_CHAR)
+ || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_NONE)
+ || (textPtr->selTagPtr->wrapMode == TEXT_WRAPMODE_WORD)) {
textPtr->selTagPtr->affectsDisplay = 1;
textPtr->selTagPtr->affectsDisplayGeometry = 1;
}
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index e6b04cc..ee56ba3 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -6,8 +6,8 @@
* widgets. (Well, strictly, each TkTextLine and B-tree node caches its
* last observed pixel height, but that information originates here).
*
- * Copyright © 1992-1994 The Regents of the University of California.
- * Copyright © 1994-1997 Sun Microsystems, Inc.
+ * Copyright © 1992-1994 The Regents of the University of California.
+ * Copyright © 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -153,7 +153,7 @@ typedef struct StyleValues {
int spacing3; /* Spacing below last dline in text line. */
TkTextTabArray *tabArrayPtr;/* Locations and types of tab stops (may be
* NULL). */
- int tabStyle; /* One of TABULAR or WORDPROCESSOR. */
+ int tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */
int underline; /* Non-zero means draw underline underneath
* text. */
XColor *underlineColor; /* Foreground color for underline underneath
@@ -440,7 +440,7 @@ typedef struct TextDInfo {
* points to one of the following structures:
*/
-#if !defined(TK_LAYOUT_WITH_BASE_CHUNKS)
+#ifndef TK_LAYOUT_WITH_BASE_CHUNKS
typedef struct CharInfo {
int numBytes; /* Number of bytes to display. */
@@ -965,7 +965,8 @@ GetStyle(
styleValues.tabArrayPtr = tagPtr->tabArrayPtr;
tabPrio = tagPtr->priority;
}
- if ((tagPtr->tabStyle != TK_TEXT_TABSTYLE_NONE)
+ if (((tagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR)
+ || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR))
&& (tagPtr->priority > tabStylePrio)) {
styleValues.tabStyle = tagPtr->tabStyle;
tabStylePrio = tagPtr->priority;
@@ -985,7 +986,9 @@ GetStyle(
styleValues.elide = tagPtr->elide;
elidePrio = tagPtr->priority;
}
- if ((tagPtr->wrapMode != TEXT_WRAPMODE_NULL)
+ if (((tagPtr->wrapMode == TEXT_WRAPMODE_CHAR)
+ || (tagPtr->wrapMode == TEXT_WRAPMODE_NONE)
+ || (tagPtr->wrapMode == TEXT_WRAPMODE_WORD))
&& (tagPtr->priority > wrapPrio)) {
styleValues.wrapMode = tagPtr->wrapMode;
wrapPrio = tagPtr->priority;
@@ -1170,7 +1173,7 @@ LayoutDLine(
* chunk. */
TkTextTabArray *tabArrayPtr;/* Tab stops for line; taken from style for
* the first character on line. */
- int tabStyle; /* One of TABULAR or WORDPROCESSOR. */
+ int tabStyle; /* One of TK_TEXT_TABSTYLE_TABULAR or TK_TEXT_TABSTYLE_WORDPROCESSOR. */
int tabSize; /* Number of pixels consumed by current tab
* stop. */
TkTextDispChunk *lastCharChunkPtr;
@@ -7767,7 +7770,7 @@ TkTextCharLayoutProc(
chunkPtr->width = nextX - chunkPtr->x;
chunkPtr->breakIndex = -1;
-#if !defined(TK_LAYOUT_WITH_BASE_CHUNKS)
+#ifndef TK_LAYOUT_WITH_BASE_CHUNKS
ciPtr = (CharInfo *)ckalloc(offsetof(CharInfo, chars) + 1 + bytesThatFit);
chunkPtr->clientData = ciPtr;
memcpy(ciPtr->chars, p, bytesThatFit);
@@ -7883,7 +7886,7 @@ CharChunkMeasureChars(
Tk_Font tkfont = chunkPtr->stylePtr->sValuePtr->tkfont;
CharInfo *ciPtr = (CharInfo *)chunkPtr->clientData;
-#if !defined(TK_LAYOUT_WITH_BASE_CHUNKS)
+#ifndef TK_LAYOUT_WITH_BASE_CHUNKS
if (chars == NULL) {
chars = ciPtr->chars;
charsLen = ciPtr->numBytes;
@@ -9017,7 +9020,7 @@ IsSameFGStyle(
return 1;
}
-#if !defined(TK_DRAW_IN_CONTEXT)
+#ifndef TK_DRAW_IN_CONTEXT
if (
#ifdef MAC_OSX_TK
!TkMacOSXCompareColors(style1->fgGC->foreground,
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index bd93258..f55b884 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -4,8 +4,8 @@
* This module provides functions that manipulate indices for text
* widgets.
*
- * Copyright © 1992-1994 The Regents of the University of California.
- * Copyright © 1994-1997 Sun Microsystems, Inc.
+ * Copyright © 1992-1994 The Regents of the University of California.
+ * Copyright © 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 8c7d6a4..66ad677 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -70,7 +70,7 @@ static const Tk_OptionSpec tagOptionSpecs[] = {
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_COLOR, "-overstrikefg", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor),
- TK_OPTION_NULL_OK, 0, 0},
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-relief", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-rmargin", NULL, NULL,
@@ -97,7 +97,7 @@ static const Tk_OptionSpec tagOptionSpecs[] = {
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_COLOR, "-underlinefg", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor),
- TK_OPTION_NULL_OK, 0, 0},
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL,
NULL, TCL_INDEX_NONE, offsetof(TkTextTag, wrapMode),
TK_OPTION_NULL_OK, wrapStrings, 0},
@@ -526,8 +526,11 @@ TkTextTagCmd(
|| (tagPtr->spacing2String != NULL)
|| (tagPtr->spacing3String != NULL)
|| (tagPtr->tabStringPtr != NULL)
- || (tagPtr->tabStyle != TK_TEXT_TABSTYLE_NONE)
- || (tagPtr->wrapMode != TEXT_WRAPMODE_NULL)) {
+ || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR)
+ || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR)
+ || (tagPtr->wrapMode == TEXT_WRAPMODE_CHAR)
+ || (tagPtr->wrapMode == TEXT_WRAPMODE_NONE)
+ || (tagPtr->wrapMode == TEXT_WRAPMODE_WORD)) {
tagPtr->affectsDisplay = 1;
tagPtr->affectsDisplayGeometry = 1;
}