On Tue, May 27, 2014 at 10:35:15PM +0200, Georg Baum wrote: > Pavel Sanda wrote: > > > Georg Baum wrote: > >> release notes that there are known issues with complex beamer documents. > > > > I don't know whether you consider this document complex, but I still see > > the end_layout issue, see attachment. > > With this document I don't see an \end_layout problem, but a broken > \end_document if you run it htough lyx2lyx: It becomes \end_documen, and the > last line end is removed as well. This happens even for the no-op conversion > to format 474.
I actually don't see this. Looking at the converted file, I rather see that an EndFrame layout gets wrongly nested as follows: \begin_layout \begin_inset Graphics filename commit.png height 80theight% \end_inset \begin_layout EndFrame <= <= These lines should be after the next \end_layout <= \end_layout tag \end_layout This smells like an off-by-one error, and indeed it is easy to spot it. With the attached patch I can load the example document without warnings. > Something is really fishy here, but I don't understand what is wrong. Why is > the document corrupted even if you tell lyx2lyx to convert it to the version > it already has? This should not have anything to do with beamer, since the > beamer routines should not be called in this case. As already said, I cannot reproduce this. > Anyway, since nobody has time to have a deep look and set up a test suite, I > still think it is a good idea to do the final 2.0 release, and I also think > that the current warning is fine. Hmm... -- Enrico
diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index 0c170d4..cfc561f 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -3626,7 +3626,7 @@ def revert_newframes(document): if document.body[j] == "\\end_deeper": document.body[j : j] = [""] + esubst else: - document.body[j : j] = esubst + document.body[j+1 : j+1] = esubst for q in range(i, j): if document.body[q] == "\\begin_layout %s" % val: document.body[q] = "\\begin_layout %s" % document.default_layout