This patch fixes bug 1816.

I don't understand why the pextra_widthp argument goes in a separate line, 
but if it happens then this patch takes that into account.

The patch seems clean, and safe, so I will apply it it. Any objection?
-- 
José Abílio
Index: lyx_1_2.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx_1_2.py,v
retrieving revision 1.6
diff -u -p -r1.6 lyx_1_2.py
--- lyx_1_2.py	5 Jan 2005 18:52:59 -0000	1.6
+++ lyx_1_2.py	14 Feb 2005 11:07:36 -0000
@@ -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"\s*\\pextra_widthp\s+\S*")
 
 def remove_pextra(file):
     lines = file.body
@@ -145,6 +146,12 @@ def remove_pextra(file):
 	i = find_re(lines, pextra_type2_rexp, i)
 	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)

Reply via email to