]> git.lyx.org Git - features.git/commitdiff
Improve beamer frame conversion: consider explicit EndFrames between two identical...
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 11 Nov 2013 08:16:17 +0000 (09:16 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 11 Nov 2013 08:16:17 +0000 (09:16 +0100)
lib/lyx2lyx/lyx_2_1.py

index 6a58754ec285c2cbff09e5d009caca3bd5f1deb5..041ed919c153e48b5814e57638e1c7d081f6e9ca 100644 (file)
@@ -3878,6 +3878,13 @@ def convert_lyxframes(document):
                     old = document.body[fend]
                     if val == frametype:
                         document.body[fend : fend] = ['\\end_deeper', '', '\\begin_layout Separator', '', '\\end_layout']
+                    # consider explicit EndFrames between two identical frame types
+                    elif val == "EndFrame":
+                        nextlayout = find_token(document.body, "\\begin_layout", fend + 1)
+                        if nextlayout != -1 and get_value(document.body, "\\begin_layout", nextlayout) == frametype:
+                            document.body[fend : fend] = ['\\end_deeper', '', '\\begin_layout Separator', '', '\\end_layout']
+                        else:
+                            document.body[fend : fend] = ['\\end_deeper']
                     else:
                         document.body[fend : fend] = ['\\end_deeper']
                     document.body[j + 1 : j + 1] = ['', '\\begin_deeper']