]> git.lyx.org Git - features.git/commitdiff
Minor cleanup for IEEETran reversion.
authorRichard Heck <rgheck@comcast.net>
Thu, 4 Nov 2010 17:16:23 +0000 (17:16 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 4 Nov 2010 17:16:23 +0000 (17:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36081 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/lyx_2_0.py

index 681e41811818b6c1fca21d08d8a8038cce60a7d6..b628d8bb1d14fedb1778a0c2a2745f0e3f9a2d3e 100644 (file)
@@ -1507,7 +1507,7 @@ def revert_IEEEtran(document):
         i = find_token(document.body, '\\begin_layout ' + layout, i)
         if i == -1:
           break
-        j = find_end_of(document.body, i, '\\begin_layout', '\\end_layout')
+        j = find_end_of_layout(document.body, i)
         if j == -1:
           document.warning("Malformed LyX document: Can't find end of " + layout + " layout.")
           i += 1
@@ -1515,10 +1515,11 @@ def revert_IEEEtran(document):
         if layout in obsoletedby:
           document.body[i] = "\\begin_layout " + obsoletedby[layout]
           i = j
-        else:
-          content = lyx2latex(document, document.body[i:j + 1])
-          add_to_preamble(document, [latexcmd[layout] + "{" + content + "}"])
-          del document.body[i:j + 1]
+          continue
+        content = lyx2latex(document, document.body[i:j + 1])
+        add_to_preamble(document, [latexcmd[layout] + "{" + content + "}"])
+        del document.body[i:j + 1]
+        # no need to reset i
 
 
 def convert_prettyref(document):