lyx_1_6.py: fix endless loop, but routine is still not working, see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg128426.html

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20677 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2007-10-03 00:09:47 +00:00
parent 6931fdf381
commit 612504b796

View File

@ -303,6 +303,8 @@ def revert_inset_command(document):
Some insets may end up being converted to insets earlier versions of LyX Some insets may end up being converted to insets earlier versions of LyX
will not be able to recognize. Not sure what to do about that. will not be able to recognize. Not sure what to do about that.
""" """
# FIXME, this routine doesn't work, must be fixed before LyX 1.6.0, see
# http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg128426.html
i = 0 i = 0
while 1: while 1:
i = find_token(document.body, "\\begin_inset CommandInset", i) i = find_token(document.body, "\\begin_inset CommandInset", i)
@ -311,7 +313,7 @@ def revert_inset_command(document):
m = r.match(nextline) m = r.match(nextline)
if not m: if not m:
document.warning("Malformed LyX document: Missing LatexCommand in " + document.body[i] + ".") document.warning("Malformed LyX document: Missing LatexCommand in " + document.body[i] + ".")
continue return
cmdName = m.group(1) cmdName = m.group(1)
insertion = ["\\begin_inset LatexCommand " + cmdName] insertion = ["\\begin_inset LatexCommand " + cmdName]
document.body[i : i+2] = insertion document.body[i : i+2] = insertion