From: Juergen Spitzmueller Date: Fri, 13 Feb 2015 09:15:29 +0000 (+0100) Subject: Fix conversion of frame ends when frame is nested in inset X-Git-Tag: 2.1.4~223 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e85eb8b833eb1efb35896c1aaa804fec9b974aa5;p=features.git Fix conversion of frame ends when frame is nested in inset Fixes: #9409 --- diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index 58b290b5c0..703acdfc44 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -28,7 +28,7 @@ import sys, os from parser_tools import count_pars_in_inset, del_token, find_token, find_token_exact, \ find_token_backwards, find_end_of, find_end_of_inset, find_end_of_layout, \ find_end_of_sequence, find_re, get_option_value, get_containing_layout, \ - get_value, get_quoted_value, set_option_value + get_containing_inset, get_value, get_quoted_value, set_option_value #from parser_tools import find_token, find_end_of, find_tokens, \ #find_end_of_inset, find_end_of_layout, \ @@ -4150,6 +4150,7 @@ def convert_lyxframes(document): # Step III: find real frame end j = j + 8 jj = j + inInset = get_containing_inset(document.body, i) while True: fend = find_token(document.body, "\\begin_layout", jj) if fend == -1: @@ -4159,7 +4160,11 @@ def convert_lyxframes(document): if val not in frameend: jj = fend + 1 continue - old = document.body[fend] + # is this frame nested in an inset (e.g., Note)? + if inInset != False: + # if so, end the frame inside the inset + if inInset[2] < fend: + fend = inInset[2] if val == frametype: document.body[fend : fend] = ['\\end_deeper', '', '\\begin_layout Separator', '', '\\end_layout'] # consider explicit EndFrames between two identical frame types diff --git a/status.21x b/status.21x index c589e7039b..166988ef7e 100644 --- a/status.21x +++ b/status.21x @@ -60,6 +60,8 @@ What's new * LYX2LYX +- Fix conversion of frame ends when frame is nested in inset (bug 9409). + * USER INTERFACE