mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 10:47:57 +00:00
Fix bug reported by Martin.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5385 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e1a68ef733
commit
36afcb3f8e
@ -213,10 +213,12 @@ def remove_oldert(lines):
|
|||||||
break
|
break
|
||||||
j = i+1
|
j = i+1
|
||||||
while 1:
|
while 1:
|
||||||
j = find_tokens(lines, ["\\latex default", "\\begin_inset", "\\layout", "\\end_inset", "\\end_float", "\\the_end"],
|
# \end_inset is for ert inside a tabular cell. The other tokens
|
||||||
|
# are obvious.
|
||||||
|
j = find_tokens(lines, ["\\latex default", "\\layout", "\\begin_inset", "\\end_inset", "\\end_float", "\\the_end"],
|
||||||
j)
|
j)
|
||||||
if check_token(lines[j], "\\begin_inset"):
|
if check_token(lines[j], "\\begin_inset"):
|
||||||
j = find_end_of_inset(lines, j)
|
j = find_end_of_inset(lines, j)+1
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -92,16 +92,18 @@ def del_token(lines, token, i, j):
|
|||||||
|
|
||||||
# Finds the paragraph that contains line i.
|
# Finds the paragraph that contains line i.
|
||||||
def get_paragraph(lines, i):
|
def get_paragraph(lines, i):
|
||||||
while 1:
|
while i != -1:
|
||||||
i = find_tokens_backwards(lines, ["\\end_inset", "\\layout"], i)
|
i = find_tokens_backwards(lines, ["\\end_inset", "\\layout"], i)
|
||||||
|
if i == -1: return -1
|
||||||
if check_token(lines[i], "\\layout"):
|
if check_token(lines[i], "\\layout"):
|
||||||
return i
|
return i
|
||||||
i = find_beginning_of_inset(lines, i)
|
i = find_beginning_of_inset(lines, i)
|
||||||
|
|
||||||
# Finds the paragraph after the paragraph that contains line i.
|
# Finds the paragraph after the paragraph that contains line i.
|
||||||
def get_next_paragraph(lines, i):
|
def get_next_paragraph(lines, i):
|
||||||
while 1:
|
while i != -1:
|
||||||
i = find_tokens(lines, ["\\begin_inset", "\\layout"], i)
|
i = find_tokens(lines, ["\\begin_inset", "\\layout"], i)
|
||||||
|
if i == -1: return -1
|
||||||
if check_token(lines[i], "\\layout"):
|
if check_token(lines[i], "\\layout"):
|
||||||
return i
|
return i
|
||||||
i = find_end_of_inset(lines, i)
|
i = find_end_of_inset(lines, i)
|
||||||
|
Loading…
Reference in New Issue
Block a user