From: Juergen Spitzmueller Date: Sat, 26 Apr 2014 15:39:56 +0000 (+0200) Subject: Fix conversion of beamer block titles that end with a non-ERT inset. X-Git-Tag: 2.2.0alpha1~1998 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=dced4924894029993041a9e8bfc0676fcd3769a8;p=features.git Fix conversion of beamer block titles that end with a non-ERT inset. Should also go to branch! --- diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index 33db564edc..24bb22ee3e 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -2978,7 +2978,16 @@ def convert_beamerblocks(document): if i != -1: if document.body[parbeg] == "\\begin_inset ERT": ertcontfirstline = parbeg + 5 - ertcontlastline = parend - 6 + # Find the last ERT in this paragraph (which might also be the first) + lastertbeg = find_token_backwards(document.body, "\\begin_inset ERT", j) + if lastertbeg == -1: + document.warning("Last ERT not found!") + break + lastertend = find_end_of_inset(document.body, lastertbeg) + if lastertend == -1: + document.warning("End of last ERT not found!") + break + ertcontlastline = lastertend - 3 while True: if document.body[ertcontfirstline].startswith("<"): # This is an overlay specification