diff --git a/lib/ChangeLog b/lib/ChangeLog index 0c84fd64fc..e52e4a01d2 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2002-10-09 Dekel Tsur + + * lyx2lyx/lyxconvert_218.py: Combine ert insets only when they are + in the Standard layout. + 2002-10-05 Dekel Tsur * lyx2lyx/lyxconvert_218.py (fix_oldfloatinset): Search for diff --git a/lib/lyx2lyx/lyxconvert_218.py b/lib/lyx2lyx/lyxconvert_218.py index eb1428cc39..d94de6f4c8 100644 --- a/lib/lyx2lyx/lyxconvert_218.py +++ b/lib/lyx2lyx/lyxconvert_218.py @@ -320,9 +320,13 @@ def remove_oldertinset(lines): i = i+1 def is_ert_paragraph(lines, i): + if not check_token(lines[i], "\\layout Standard"): + return 0 + i = find_nonempty_line(lines, i+1) if not check_token(lines[i], "\\begin_inset ERT"): return 0 + j = find_end_of_inset(lines, i) k = find_nonempty_line(lines, j+1) return check_token(lines[k], "\\layout") @@ -333,7 +337,7 @@ def combine_ert(lines): i = find_token(lines, "\\begin_inset ERT", i) if i == -1: break - j = find_token_backwards(lines,"\\layout", i-1) + j = get_paragraph(lines, i) count = 0 text = [] while is_ert_paragraph(lines, j):