]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx_2_2.py
booktabs: support for \cmidrule trimming
[lyx.git] / lib / lyx2lyx / lyx_2_2.py
index b336f8b44651657add9e7e99b80a2002091ff4ee..9011c66975076ba5ed992f1693b8889561430c6f 100644 (file)
@@ -25,7 +25,8 @@ import sys, os
 # Uncomment only what you need to import, please.
 
 from lyx2lyx_tools import (add_to_preamble, put_cmd_in_ert, get_ert,
-    lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets, insert_document_option)
+    lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets, insert_document_option,
+    revert_language)
 
 from parser_tools import (check_token, del_complete_lines,
     find_end_of_inset, find_end_of_layout, find_nonempty_line, find_re,
@@ -346,7 +347,8 @@ def convert_parbreak(document):
             return
         lay = get_containing_layout(document.body, i)
         if lay == False:
-            document.warning("Malformed LyX document: Can't convert separator inset at line " + str(i))
+            document.warning("Malformed LyX document: "
+                             "Can't convert separator inset at line %d"%i)
             i += 1
             continue
         if lay[0] == "Standard":
@@ -851,15 +853,7 @@ def revert_specialchar(document):
 def revert_georgian(document):
     "Set the document language to English but assure Georgian output"
 
-    if document.language == "georgian":
-        document.language = "english"
-        i = find_token(document.header, "\\language georgian", 0)
-        if i != -1:
-            document.header[i] = "\\language english"
-        j = find_token(document.header, "\\language_package default", 0)
-        if j != -1:
-            document.header[j] = "\\language_package babel"
-        insert_document_option(document, "georgian")
+    revert_language(document, "georgian", "georgian", "")
 
 
 def revert_sigplan_doi(document):
@@ -1373,11 +1367,11 @@ def revert_jss(document):
         i = 0
         while True:
             i = find_token(document.body, "\\begin_inset Flex " + iltype, i)
-            if i != -1:
+            if i == -1:
                 break
 
-            if iltype == "Code" and document.body[i][-1] != "e":
-                # Code Chunk inset. Continue
+            if document.body[i] != "\\begin_inset Flex " + iltype:
+                # Not an exact match!
                 i += 1
                 continue