From 239b9377e776ad5d65fddf6c1827f5508b3bfe26 Mon Sep 17 00:00:00 2001 From: Dekel Tsur Date: Fri, 14 Mar 2003 15:29:01 +0000 Subject: [PATCH] Fix conversion of minipages that contains tabulars. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@6507 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 5 +++++ lib/lyx2lyx/lyxconvert_218.py | 7 ++----- lib/lyx2lyx/parser_tools.py | 5 ++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 7756f55839..c1752d0f05 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-03-14 Dekel Tsur + + * lyx2lyx/lyxconvert_218.py (remove_pextra): Fix conversion of + minipages that contains tabulars. + 2003-03-14 Jean-Marc Lasgouttes * templates/revtex4.lyx: diff --git a/lib/lyx2lyx/lyxconvert_218.py b/lib/lyx2lyx/lyxconvert_218.py index 3f0c45e8bf..b99292bc2e 100644 --- a/lib/lyx2lyx/lyxconvert_218.py +++ b/lib/lyx2lyx/lyxconvert_218.py @@ -164,11 +164,8 @@ def remove_pextra(lines): else: start = ["\\layout Standard"] + start - j = find_token_backwards(lines,"\\layout", i-1) - j0 = j - - j = find_tokens(lines, ["\\layout", "\\end_float"], i+1) - # j can be -1 + j0 = find_token_backwards(lines,"\\layout", i-1) + j = get_next_paragraph(lines, i) count = 0 while 1: diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py index adf711b99d..312fa4fa35 100644 --- a/lib/lyx2lyx/parser_tools.py +++ b/lib/lyx2lyx/parser_tools.py @@ -105,9 +105,8 @@ def get_paragraph(lines, i): # Finds the paragraph after the paragraph that contains line i. def get_next_paragraph(lines, i): while i != -1: - i = find_tokens(lines, ["\\begin_inset", "\\layout"], i) - if i == -1: return -1 - if check_token(lines[i], "\\layout"): + i = find_tokens(lines, ["\\begin_inset", "\\layout", "\\end_float", "\\the_end"], i) + if not check_token(lines[i], "\\begin_inset"): return i i = find_end_of_inset(lines, i)