]> git.lyx.org Git - features.git/blobdiff - lib/lyx2lyx/lyx_1_6.py
Stupid mistake.
[features.git] / lib / lyx2lyx / lyx_1_6.py
index f7050544703d009a09aae05c4a236d40a4b64197..031f1cdc16cc133a02a492bfd67ff4c3052ca00f 100644 (file)
@@ -308,12 +308,14 @@ def revert_inset_command(document):
   i = 0
   while 1:
     i = find_token(document.body, "\\begin_inset CommandInset", i)
+    if i == -1:
+      return
     nextline = document.body[i+1]
     r = re.compile(r'LatexCommand\s+(.*)$')
     m = r.match(nextline)
     if not m:
       document.warning("Malformed LyX document: Missing LatexCommand in " + document.body[i] + ".")
-      return
+      continue
     cmdName = m.group(1)
     insertion = ["\\begin_inset LatexCommand " + cmdName]
     document.body[i : i+2] = insertion