From: José Matox Date: Thu, 6 Nov 2003 14:48:26 +0000 (+0000) Subject: Create an empty paragraph for possible upper page and line breaks, if necessary. X-Git-Tag: 1.6.10~15820 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4dc81d208a677d5d72c915f7f79fb99efa361211;p=features.git Create an empty paragraph for possible upper page and line breaks, if necessary. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8056 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index d2679f1d28..7650a1db22 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,8 @@ +2003-11-06 José Matos + + * lyxconvert_224.py (convert_breaks): Create an empty paragraph for + possible upper page and line breaks, if necessary. + 2003-10-27 José Matos * lyxconvert_223.py: diff --git a/lib/lyx2lyx/lyxconvert_224.py b/lib/lyx2lyx/lyxconvert_224.py index 2f2ad64981..d9d7ecbf96 100644 --- a/lib/lyx2lyx/lyxconvert_224.py +++ b/lib/lyx2lyx/lyxconvert_224.py @@ -203,13 +203,29 @@ def convert_breaks(lines): lines[i] = "" i = i + 1 - if pb_top != -1: - lines.insert(i, "\\newpage ") - i = i + 1 + # Create an empty paragraph for line and page break that belong + # above the paragraph + # To simplify the code, and maintain the same insertion point, + # I inserted by reverse order. It looks funny. :-) + if pb_top !=-1 or line_top != -1: + k = i - 3 + lines.insert(k, '') + lines.insert(k, '\\end_layout') + + if line_top != -1: + lines.insert(k, '') + lines.insert(k, "\\lyxline ") + i = i + 2 - if line_top != -1: - lines.insert(i, "\\lyxline ") - i = i + 1 + if pb_top != -1: + lines.insert(k, '') + lines.insert(k, "\\newpage ") + i = i + 2 + + lines.insert(k, '') + lines.insert(k, '') + lines.insert(k, '\\begin_layout Standard') + i = i + 5 # Ensure that nested style are converted later. k = find_end_of(lines, i, "\\begin_layout", "\\end_layout")