]> git.lyx.org Git - features.git/commitdiff
Similar range-->while stuff.
authorRichard Heck <rgheck@comcast.net>
Sun, 1 Jun 2008 14:27:43 +0000 (14:27 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 1 Jun 2008 14:27:43 +0000 (14:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25051 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/lyx_1_6.py

index b3bad13386fad49c1849f6c2cf1027f4567f4534..31d565b5b04d26f9c19acf1a41f3c3de12eda624 100644 (file)
@@ -1436,7 +1436,8 @@ def revert_framed_notes(document):
 def revert_slash(document):
     'Revert \\SpecialChar \\slash{} to ERT'
     r = re.compile(r'\\SpecialChar \\slash{}')
-    for i in range(len(document.body)):
+    i = 0
+    while i < len(document.body):
         m = r.match(document.body[i])
         if m:
           subst = ['\\begin_inset ERT',
@@ -1447,6 +1448,9 @@ def revert_slash(document):
                    '\\end_layout', '',
                    '\\end_inset', '']
           document.body[i: i+1] = subst
+          i = i + len(subst)
+        else:
+          i = i + 1
 
 
 def revert_nobreakdash(document):
@@ -1865,7 +1869,7 @@ def convert_spaceinset(document):
             after = m.group(2)
             subst = [before, "\\begin_inset Space " + after, "\\end_inset"]
             document.body[i: i+1] = subst
-            i = i + 3
+            i = i + len(subst)
         else:
             i = i + 1