Skip to content

Commit

Permalink
Don't test for != TEXT_WRAPMODE_NULL, since it has a different value …
Browse files Browse the repository at this point in the history
…for different Tk versions. (Tk 8.6 already does this, missed in Tk 8.7)
  • Loading branch information
jan.nijtmans committed Jul 11, 2024
1 parent 1d0390a commit 47a7d35
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion generic/tkText.c
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,9 @@ ConfigureText(
|| (textPtr->selTagPtr->tabStringPtr != NULL)
|| (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR)
|| (textPtr->selTagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR)
|| (textPtr->selTagPtr->wrapMode != TEXT_WRAPMODE_NULL)) {
|| (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;
}
Expand Down
4 changes: 2 additions & 2 deletions generic/tkTextDisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,8 @@ GetStyle(
styleValues.elide = tagPtr->elide > 0;
elidePrio = tagPtr->priority;
}
if ((tagPtr->wrapMode != TEXT_WRAPMODE_NULL)
&& (tagPtr->priority > wrapPrio)) {
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;
}
Expand Down
4 changes: 3 additions & 1 deletion generic/tkTextTag.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,9 @@ TkTextTagCmd(
|| (tagPtr->tabStringPtr != NULL)
|| (tagPtr->tabStyle == TK_TEXT_TABSTYLE_TABULAR)
|| (tagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR)
|| (tagPtr->wrapMode != TEXT_WRAPMODE_NULL)) {
|| (tagPtr->wrapMode == TEXT_WRAPMODE_CHAR)
|| (tagPtr->wrapMode == TEXT_WRAPMODE_NONE)
|| (tagPtr->wrapMode == TEXT_WRAPMODE_WORD)) {
tagPtr->affectsDisplay = 1;
tagPtr->affectsDisplayGeometry = 1;
}
Expand Down

0 comments on commit 47a7d35

Please sign in to comment.