]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx_1_2.py
Fix bug 1816.
[lyx.git] / lib / lyx2lyx / lyx_1_2.py
index d42540f1bf752c9731d0b985eb2023e1d13f9f85..5e39dd5f8c298dcec306c6f4710031f086fc0082 100644 (file)
@@ -136,6 +136,7 @@ def remove_oldfloat(file):
 
 pextra_type2_rexp = re.compile(r".*\\pextra_type\s+[12]")
 pextra_type2_rexp2 = re.compile(r".*(\\layout|\\pextra_type\s+2)")
+pextra_widthp = re.compile(r"\\pextra_widthp")
 
 def remove_pextra(file):
     lines = file.body
@@ -146,6 +147,12 @@ def remove_pextra(file):
        if i == -1:
            break
 
+        # Sometimes the \pextra_widthp argument comes in it own
+        # line. If that happens insert it back in this line.
+        if pextra_widthp.search(lines[i+1]):
+            lines[i] = lines[i] + ' ' + lines[i+1]
+            del lines[i+1]
+
        mo = pextra_rexp.search(lines[i])
         width = get_width(mo)