]> git.lyx.org Git - features.git/commitdiff
* lyx_1_6.py:
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 12 Nov 2008 09:42:37 +0000 (09:42 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 12 Nov 2008 09:42:37 +0000 (09:42 +0000)
- another bug manifesting in the UG reversion: \slash and \nobreakdash can also occur
               in the middle of a line.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27394 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/lyx_1_6.py
status.16x

index 429ff5641ee9e9358a4bb2cb23ad487b7d291052..9be03f87be8227e40272911a5dd9f1bfdfe7b0a4 100644 (file)
@@ -1804,40 +1804,45 @@ def revert_framed_notes(document):
 
 def revert_slash(document):
     'Revert \\SpecialChar \\slash{} to ERT'
-    r = re.compile(r'\\SpecialChar \\slash{}')
     i = 0
     while i < len(document.body):
-        m = r.match(document.body[i])
+        m = re.match(r'(.*)\\SpecialChar \\slash{}(.*)', document.body[i])
         if m:
-          subst = ['\\begin_inset ERT',
-                   'status collapsed', '',
-                   '\\begin_layout Standard',
-                   '', '', '\\backslash',
-                   'slash{}',
-                   '\\end_layout', '',
-                   '\\end_inset', '']
-          document.body[i: i+1] = subst
-          i = i + len(subst)
+            before = m.group(1)
+            after = m.group(2)
+            subst = [before,
+                     '\\begin_inset ERT',
+                     'status collapsed', '',
+                     '\\begin_layout Standard',
+                     '', '', '\\backslash',
+                     'slash{}',
+                     '\\end_layout', '',
+                     '\\end_inset', '',
+                     after]
+            document.body[i: i+1] = subst
+            i = i + len(subst)
         else:
-          i = i + 1
+            i = i + 1
 
 
 def revert_nobreakdash(document):
     'Revert \\SpecialChar \\nobreakdash- to ERT'
     i = 0
     while i < len(document.body):
-        line = document.body[i]
-        r = re.compile(r'\\SpecialChar \\nobreakdash-')
-        m = r.match(line)
+        m = re.match(r'(.*)\\SpecialChar \\nobreakdash-(.*)', document.body[i])
         if m:
-            subst = ['\\begin_inset ERT',
+            before = m.group(1)
+            after = m.group(2)
+            subst = [before,
+                     '\\begin_inset ERT',
                     'status collapsed', '',
                     '\\begin_layout Standard', '', '',
                     '\\backslash',
                     'nobreakdash-',
                     '\\end_layout', '',
-                    '\\end_inset', '']
-            document.body[i:i+1] = subst
+                    '\\end_inset', '',
+                     after]
+            document.body[i: i+1] = subst
             i = i + len(subst)
             j = find_token(document.header, "\\use_amsmath", 0)
             if j == -1:
index 601406f6f206e022907e1d3fe21618b4a318fc61..a70c0f46e6b3fc944cb672df0d4a6bc08ee7ae31 100644 (file)
@@ -54,9 +54,13 @@ What's new
 - Removed "NoStyle Abstract" from AMS book class, which does have an
   abstract.
 
-- Fixed reversion of info insets to LyX format 1.5.x. This bug blocked the
+- Fix reversion of info insets to LyX format 1.5.x. This bug blocked the
   reversion of the User Guide to LyX 1.5.
 
+- Fix reversion of subfloats to version 1.5.x.
+
+- Fix reversion of \slash and \nobreakdash to version 1.5.x.
+
 
 * USER INTERFACE