2014-05-13 16:56 GMT+02:00 Enrico Forestieri: > Doesn't seem to be related to roundtrips. The problem seems to be related > to the conversion of arguments. See attached example. >
The attached fixes the thinko in the lyx2lyx method. However, I do not know what this method actually is supposed to convert, so I cannot really test if the conversion works. The respective commit (by Uwe) is this: http://www.lyx.org/trac/changeset/b42604c7aa0551c4761605f1e9131b05522c98b5/lyxgit BTW I still get a console message when opening with LyX 2.2 (but not so when opening with LyX 2.1). Jürgen > > -- > Enrico >
diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index 20d87ba..0cf4e06 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -2095,7 +2095,13 @@ def convert_Initials(document): i = find_token(document.body, "\\begin_layout Initial", i) if i == -1: return - convert_TeX_brace_to_Argument(document, i, 3, 3, False, False, False) + j = find_end_of_layout(document.body, i) + if j == -1: + document.warning("Malformed LyX document: Can't find end of Initial layout") + i += 1 + continue + if find_token(document.body, "\\begin_inset ERT", i, j) != -1: + convert_TeX_brace_to_Argument(document, i, 3, 3, False, False, False) i += 1