summaryrefslogtreecommitdiffstats
path: root/generic/tkTextTag.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-20 15:41:49 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-20 15:41:49 (GMT)
commit8b6266dcbcfbfa6036baae36eb6875e31519f9d3 (patch)
treec0e68f4d9fffba49e8084ecf49b983c0c8448a39 /generic/tkTextTag.c
parentac0ac59425874c951ee09237bf6b71a35f732389 (diff)
downloadtk-8b6266dcbcfbfa6036baae36eb6875e31519f9d3.zip
tk-8b6266dcbcfbfa6036baae36eb6875e31519f9d3.tar.gz
tk-8b6266dcbcfbfa6036baae36eb6875e31519f9d3.tar.bz2
Don't use TK_TEXT_TABSTYLE_NONE/TEXT_WRAPMODE_NULL in comparisons, just use the explicit valid values instead. Also, some formatting and adding type-casts
Diffstat (limited to 'generic/tkTextTag.c')
-rw-r--r--generic/tkTextTag.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index e839013..a8b3791 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, -1, Tk_Offset(TkTextTag, overstrikeColor),
- TK_OPTION_NULL_OK, 0, 0},
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-relief", NULL, NULL,
NULL, -1, Tk_Offset(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, -1, Tk_Offset(TkTextTag, underlineColor),
- TK_OPTION_NULL_OK, 0, 0},
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL,
NULL, -1, Tk_Offset(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;
}