From: Dekel Tsur Date: Tue, 1 Oct 2002 14:17:31 +0000 (+0000) Subject: Few fixes. X-Git-Tag: 1.6.10~18222 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8b5e7434b4a346a61ba449306f6d6d226f53a5ec;p=features.git Few fixes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5354 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 463976830b..ba8537a196 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,11 @@ +2002-10-01 Dekel Tsur + + * lyx2lyx/lyxconvert_218.py: Handle end_deeper "inside" ERT. + (remove_oldert): Fix for ERT inside tabulars. + (change_listof): New function. Convert LatexCommand inset to + FloatList inset. + (fix_oldfloatinset): New function. Add "wide false" to float insets. + 2002-09-25 Dekel Tsur * Makefile.am: Patch from Georg Baum for installing lyx2lyx files. diff --git a/lib/lyx2lyx/lyxconvert_218.py b/lib/lyx2lyx/lyxconvert_218.py index df3e884bc3..8602ca4904 100644 --- a/lib/lyx2lyx/lyxconvert_218.py +++ b/lib/lyx2lyx/lyxconvert_218.py @@ -205,7 +205,7 @@ def remove_oldert(lines): break j = i+1 while 1: - j = find_tokens(lines, ["\\latex default", "\\begin_inset", "\\layout", "\\end_float", "\\the_end"], + j = find_tokens(lines, ["\\latex default", "\\begin_inset", "\\layout", "\\end_inset", "\\end_float", "\\the_end"], j) if check_token(lines[j], "\\begin_inset"): j = find_end_of_inset(lines, j) @@ -295,7 +295,7 @@ def remove_oldert(lines): break del lines[i] - +# ERT insert are hidden feature of lyx 1.1.6. This might be removed in the future. def remove_oldertinset(lines): i = 0 while 1: @@ -437,6 +437,28 @@ def update_tabular(lines): i = i+1 +# Figure insert are hidden feature of lyx 1.1.6. This might be removed in the future. +def fix_oldfloatinset(lines): + i = 0 + while 1: + i = find_token(lines, "\\begin_inset Float", i) + if i == -1: + break + j = find_token(lines, "collapsed", i) + if j != -1: + lines[j:j] = ["wide false"] + i = i+1 + +def change_listof(lines): + i = 0 + while 1: + i = find_token(lines, "\\begin_inset LatexCommand \\listof", i) + if i == -1: + break + type = lines[i][33:-3] + lines[i] = "\\begin_inset FloatList "+type + i = i+1 + def change_preamble(lines): i = find_token(lines, "\\use_amsmath", 0) if i == -1: @@ -450,6 +472,8 @@ def convert(header, body): language = "english" change_preamble(header) + change_listof(body) + fix_oldfloatinset(body) update_tabular(body) remove_oldminipage(body) remove_oldfloat(body, language)