Improve beamer frame conversion: consider explicit EndFrames between two identical frame types

This commit is contained in:
Juergen Spitzmueller 2013-11-11 09:16:17 +01:00
parent 86efb5938d
commit 0f18bc753c

View 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']