* lyx2lyx/lyx_1_6.py (revert_rotfloat, revert_widesideways, revert_subfig):

- when searching \begin_inset Float, exclude \begin_inset FloatList (bug 4824)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24608 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-05-05 06:37:25 +00:00
parent 0270addb11
commit 98b51ebfbc

View File

@ -1548,12 +1548,17 @@ def revert_rotfloat(document):
" Revert sideways custom floats. "
i = 0
while 1:
i = find_token(document.body, "\\begin_inset Float", i)
# whitespace intended (exclude \\begin_inset FloatList)
i = find_token(document.body, "\\begin_inset Float ", i)
if i == -1:
return
line = document.body[i]
r = re.compile(r'\\begin_inset Float (.*)$')
m = r.match(line)
if m == None:
document.warning("Unable to match line " + str(i) + " of body!")
i += 1
continue
floattype = m.group(1)
if floattype == "figure" or floattype == "table":
i = i + 1
@ -1593,12 +1598,17 @@ def revert_widesideways(document):
" Revert wide sideways floats. "
i = 0
while 1:
i = find_token(document.body, '\\begin_inset Float', i)
# whitespace intended (exclude \\begin_inset FloatList)
i = find_token(document.body, '\\begin_inset Float ', i)
if i == -1:
return
line = document.body[i]
r = re.compile(r'\\begin_inset Float (.*)$')
m = r.match(line)
if m == None:
document.warning("Unable to match line " + str(i) + " of body!")
i += 1
continue
floattype = m.group(1)
if floattype != "figure" and floattype != "table":
i = i + 1
@ -1685,7 +1695,8 @@ def revert_subfig(document):
" Revert subfloats. "
i = 0
while 1:
i = find_token(document.body, '\\begin_inset Float', i)
# whitespace intended (exclude \\begin_inset FloatList)
i = find_token(document.body, '\\begin_inset Float ', i)
if i == -1:
return
while 1:
@ -1695,7 +1706,8 @@ def revert_subfig(document):
i = i + 1
continue
# look for embedded float (= subfloat)
k = find_token(document.body, '\\begin_inset Float', i + 1, j)
# whitespace intended (exclude \\begin_inset FloatList)
k = find_token(document.body, '\\begin_inset Float ', i + 1, j)
if k == -1:
break
l = find_end_of_inset(document.body, k)