Fix reversion of beamer overprint when a nested paragraph has an argument

This commit is contained in:
Juergen Spitzmueller 2014-05-21 11:36:47 +02:00
parent c9fdf37678
commit 02410adbfe

View File

@ -3166,19 +3166,22 @@ def revert_overprint(document):
r = r + 1 r = r + 1
argbeg = find_token(document.body, "\\begin_inset Argument 1", i, j) argbeg = find_token(document.body, "\\begin_inset Argument 1", i, j)
if argbeg != -1: if argbeg != -1:
argend = find_end_of_inset(document.body, argbeg) # Is this really our argument?
if argend == -1: nested = find_token(document.body, "\\begin_deeper", i, argbeg)
document.warning("Malformed LyX document. Cannot find end of Overprint argument!") if nested != -1:
i += 1 argend = find_end_of_inset(document.body, argbeg)
continue if argend == -1:
beginPlain = find_token(document.body, "\\begin_layout Plain Layout", argbeg) document.warning("Malformed LyX document. Cannot find end of Overprint argument!")
endPlain = find_end_of_layout(document.body, beginPlain) i += 1
content = document.body[beginPlain + 1 : endPlain] continue
# Adjust range end beginPlain = find_token(document.body, "\\begin_layout Plain Layout", argbeg)
endseq = endseq - len(document.body[argbeg : argend]) endPlain = find_end_of_layout(document.body, beginPlain)
# Remove arg inset content = document.body[beginPlain + 1 : endPlain]
del document.body[argbeg : argend + 1] # Adjust range end
subst += put_cmd_in_ert("[") + content + put_cmd_in_ert("]") endseq = endseq - len(document.body[argbeg : argend])
# Remove arg inset
del document.body[argbeg : argend + 1]
subst += put_cmd_in_ert("[") + content + put_cmd_in_ert("]")
endseq = endseq - len(document.body[i : i]) endseq = endseq - len(document.body[i : i])
document.body[i : i] = subst + ["\\end_layout"] document.body[i : i] = subst + ["\\end_layout"]