]> git.lyx.org Git - features.git/commitdiff
Fix convert_separator routine with ancient LyX files.
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 19 Feb 2018 17:03:52 +0000 (18:03 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 22 Feb 2018 09:25:18 +0000 (10:25 +0100)
lib/lyx2lyx/lyx_2_2.py

index ced6482e1fac5838f941311fccbbae740737dc64..96b456accb7c0746cefbf930faceb5096a39a4c4 100644 (file)
@@ -186,6 +186,13 @@ def convert_separator(document):
 
         j = find_token_backwards(document.body, "\\end_layout", i-1)
         if j != -1:
+            # Very old LyX files do not have Plain Layout in insets (but Standard).
+            # So we additionally check here if there is no inset boundary
+            # between the previous layout and this one.
+            n = find_token(document.body, "\\end_inset", j, lay[1])
+            if n != -1:
+                i = i + 1
+                continue
             lay = get_containing_layout(document.body, j-1)
             if lay != False and lay[0] == "Standard" \
                and find_token(document.body, "\\align", lay[1], lay[2]) == -1 \