]> git.lyx.org Git - features.git/commitdiff
Create an empty paragraph for possible upper page and line breaks, if necessary.
authorJosé Matox <jamatos@lyx.org>
Thu, 6 Nov 2003 14:48:26 +0000 (14:48 +0000)
committerJosé Matox <jamatos@lyx.org>
Thu, 6 Nov 2003 14:48:26 +0000 (14:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8056 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/ChangeLog
lib/lyx2lyx/lyxconvert_224.py

index d2679f1d289195c06d079747520f458045e7fbb4..7650a1db2234faff6e843f1c5c4f615d87c25f06 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-06  José Matos  <jamatos@lyx.org>
+
+       * lyxconvert_224.py (convert_breaks): Create an empty paragraph for
+       possible upper page and line breaks, if necessary.
+
 2003-10-27  José Matos  <jamatos@lyx.org>
 
        * lyxconvert_223.py:
index 2f2ad64981d72fbbe2a08a96ec88567c831ccc9e..d9d7ecbf96e31ec9694ffc2775124555151d9ac1 100644 (file)
@@ -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")