]> git.lyx.org Git - features.git/commitdiff
Further simplification
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 10 Mar 2019 11:43:09 +0000 (12:43 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:59 +0000 (14:39 +0200)
lib/lyx2lyx/lyx2lyx_tools.py

index a2930dee43899f6a6636bb9df83a6be8f5ba2cff..51b4ec4411a90262d8c23b8fb7f9a3db9fc2ed88 100644 (file)
@@ -572,7 +572,7 @@ def insert_document_option(document, option):
         return
 
     # add it to the end of the options
-    document.header[options_line] += " ,%s" % option
+    document.header[options_line] += ",%s" % option
 
 
 def remove_document_option(document, option):
@@ -746,13 +746,7 @@ def revert_language(document, lyxname, babelname, polyglossianame):
 
         # With babel, we need to add the language options
         if with_babel and (primary or secondary):
-            k = find_token(document.header, "\\options")
-            if k != -1:
-                opts = get_value(document.header, "\\options", i)
-                document.header[k] = "\\options %s,%s" % (opts, babelname)
-            else:
-                l = find_token(document.header, "\\use_default_options")
-                document.header.insert(l + 1, "\\options %s" % babelname)
+            insert_document_option(document, babelname)
             if secondary:
                 # Since the user options are always placed after the babel options,
                 # we need to reset the main language