From 6f3fbc9cd332d19715c62c93d221cd41d4131dc6 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Wed, 15 Oct 2014 14:07:14 +0200 Subject: [PATCH] lyx2lyx: fix convert_chunks for empty chunk layouts Fixes: #9298 --- lib/lyx2lyx/lyx_2_1.py | 7 ++++++- status.21x | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index 289a4d4b85..6b2a75f82c 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -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 == "@": diff --git a/status.21x b/status.21x index 1a9f7fb7ee..78dfa5f5b9 100644 --- a/status.21x +++ b/status.21x @@ -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 -- 2.39.5