From 46cacd9dc5f61637b57fa93904ecfdaad18757b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Tue, 15 Feb 2005 12:04:26 +0000 Subject: [PATCH] Fix bug 1816. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9633 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/ChangeLog | 4 ++++ lib/lyx2lyx/lyx_1_2.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index 17fb51b0a4..1dbb09b576 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,7 @@ +2005-02-15 José Matos + + * lyx_1_2.py (remove_pextra): fix bug 1816. + 2005-02-06 Georg Baum * lyx_1_4.py (convert_ertbackslash): convert '\n', too diff --git a/lib/lyx2lyx/lyx_1_2.py b/lib/lyx2lyx/lyx_1_2.py index d42540f1bf..5e39dd5f8c 100644 --- a/lib/lyx2lyx/lyx_1_2.py +++ b/lib/lyx2lyx/lyx_1_2.py @@ -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) -- 2.39.2