[LyX/master] Fix logic

Juergen Spitzmueller <[email protected]> Mon, 03 Aug 2026 16:54:56 +0000
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 2968b5021db6c6413ebb68ab710181d3b3321676
Author: Juergen Spitzmueller <[email protected]>
Date:   Mon Aug 3 18:54:34 2026 +0200

    Fix logic
    
    Thanks to Pavel and Claude
---
 lib/lyx2lyx/lyx_2_6.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/lyx2lyx/lyx_2_6.py b/lib/lyx2lyx/lyx_2_6.py
index 272f88af41..6651e93908 100644
--- a/lib/lyx2lyx/lyx_2_6.py
+++ b/lib/lyx2lyx/lyx_2_6.py
@@ -719,7 +719,7 @@ def revert_hyphen_shorthands(document):
             break
         document.body[i] = document.body[i].replace("\\SpecialChar breakabledash", "")
         lang = mainlang
-        l = find_token_backwards(document.body, "\\lang", i) != -1
+        l = find_token_backwards(document.body, "\\lang", i)
         if l > 0:
             line = document.body[l]
             tokenend = len("\\lang ")
@@ -740,7 +740,7 @@ def revert_hyphen_shorthands(document):
             break
         document.body[i] = document.body[i].replace("\\SpecialChar extrasofthyphen", "")
         lang = mainlang
-        l = find_token_backwards(document.body, "\\lang", i) != -1
+        l = find_token_backwards(document.body, "\\lang", i)
         if l > 0:
             line = document.body[l]
             tokenend = len("\\lang ")
@@ -796,7 +796,7 @@ def revert_shorthands2(document):
             break
         document.body[i] = document.body[i].replace("\\SpecialChar gendermark", "")
         lang = mainlang
-        l = find_token_backwards(document.body, "\\lang", i) != -1
+        l = find_token_backwards(document.body, "\\lang", i)
         if l > 0:
             line = document.body[l]
             tokenend = len("\\lang ")
@@ -814,7 +814,7 @@ def revert_shorthands2(document):
             break
         document.body[i] = document.body[i].replace("\\SpecialChar abbrvdot", "")
         lang = mainlang
-        l = find_token_backwards(document.body, "\\lang", i) != -1
+        l = find_token_backwards(document.body, "\\lang", i)
         if l > 0:
             line = document.body[l]
             tokenend = len("\\lang ")
@@ -833,7 +833,7 @@ def revert_shorthands2(document):
             break
         document.body[i] = document.body[i].replace("\\SpecialChar thinspacebreakpoint", "")
         lang = mainlang
-        l = find_token_backwards(document.body, "\\lang", i) != -1
+        l = find_token_backwards(document.body, "\\lang", i)
         if l > 0:
             line = document.body[l]
             tokenend = len("\\lang ")
@@ -851,7 +851,7 @@ def revert_shorthands2(document):
             break
         document.body[i] = document.body[i].replace("\\SpecialChar splithyphen", "")
         lang = mainlang
-        l = find_token_backwards(document.body, "\\lang", i) != -1
+        l = find_token_backwards(document.body, "\\lang", i)
         if l > 0:
             line = document.body[l]
             tokenend = len("\\lang ")
@@ -877,7 +877,7 @@ def revert_shorthands2(document):
             document.body[i] = document.body[i].replace("\\SpecialChar cyrillicdash_quotative", "")
             repl = "\"--*"
         lang = mainlang
-        l = find_token_backwards(document.body, "\\lang", i) != -1
+        l = find_token_backwards(document.body, "\\lang", i)
         if l > 0:
             line = document.body[l]
             tokenend = len("\\lang ")
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs