]> git.lyx.org Git - features.git/commitdiff
lyx2lyx: fix convert_chunks for empty chunk layouts
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 15 Oct 2014 12:07:14 +0000 (14:07 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 3 Nov 2014 15:46:20 +0000 (16:46 +0100)
Fixes: #9298
lib/lyx2lyx/lyx_2_1.py
status.21x

index 289a4d4b853b2d0dd290123d688bf43411635571..6b2a75f82cb281f2430b0682c35e7f1b0123f029 100644 (file)
@@ -4577,9 +4577,14 @@ def convert_chunks(document):
         # The last chunk should simply have an "@" in it
         # or at least end with "@" (can happen if @ is
         # preceded by a newline)
-        lastpar = ''.join(contents[-1])
+        lastpar = ''
+        if len(contents) > 0:
+            lastpar = ''.join(contents[-1])
         if not lastpar.endswith("@"):
             document.warning("Unexpected chunk content: chunk not terminated by '@'!")
+            if len(contents) == 0:
+                # convert empty chunk layouts to Standard
+                document.body[start] = "\\begin_layout Standard"
             continue
 
         if lastpar == "@":
index 1a9f7fb7ee97f3d8b26b77bb440f2a45117b5377..78dfa5f5b939225936eaf6abb53a378a3e68033f 100644 (file)
@@ -81,6 +81,8 @@ What's new
 
 - Fix import of LyX 2.0 IEEEtran documents (bug 9273).
 
+- Fix import of Chunk layout with trailing empty paragraph (bug 9298).
+
 
 * USER INTERFACE