Jürgen Spitzmüller wrote: > http://bugzilla.lyx.org/show_bug.cgi?id=4035 > OK to apply?
Georg pointed me towards some cut and paste errors in the patch. Corrected patch attached. Jürgen
Index: lib/lyx2lyx/lyx_1_5.py =================================================================== --- lib/lyx2lyx/lyx_1_5.py (Revision 19112) +++ lib/lyx2lyx/lyx_1_5.py (Arbeitskopie) @@ -1616,7 +1616,7 @@ inlinecode = '' # looking for the oneline code for lstinline inlinecode = document.body[find_end_of_layout(document.body, - find_token(document.body, '\\begin_layout Standard', i + 1) +1 ) - 1] + find_token(document.body, '\\begin_layout %s' % document.default_layout, i + 1) +1 ) - 1] if len(caption) > 0: if len(params) == 0: params = 'caption={%s}' % caption @@ -1633,7 +1633,7 @@ if inline == 'true': document.body[i:(j+1)] = [r'\begin_inset ERT', 'status %s' % status, - r'\begin_layout Standard', + r'\begin_layout %s' % document.default_layout, '', '', r'\backslash', @@ -1645,7 +1645,7 @@ document.body[i: j+1] = [r'\begin_inset ERT', 'status %s' % status, '', - r'\begin_layout Standard', + r'\begin_layout %s' % document.default_layout, '', '', r'\backslash', @@ -1653,7 +1653,7 @@ r'\end_layout' ] + document.body[k : j - 1] + \ ['', - r'\begin_layout Standard', + r'\begin_layout %s' % document.default_layout, '', r'\backslash', 'end{lstlisting}', @@ -1704,7 +1704,7 @@ document.body[i : j + 1] = [r'\begin_inset ERT', 'status open', '', - r'\begin_layout Standard', + r'\begin_layout %s' % document.default_layout, '', '', r'\backslash', @@ -1803,11 +1803,11 @@ if j == -1: # this should not happen break - document.body[i : j + 1] = [r'\begin_layout Standard', + document.body[i : j + 1] = [r'\begin_layout %s' % document.default_layout, r'\begin_inset Note Note', 'status open', '', - r'\begin_layout Standard', + r'\begin_layout %s' % document.default_layout, 'Separate Environment', r'\end_layout', '', @@ -1867,7 +1867,7 @@ pass fp.close() # Define strings to start and end ERT and math insets - ert_intro='\n\n\\begin_inset ERT\nstatus collapsed\n\\begin_layout Standard\n\\backslash\n' + ert_intro='\n\n\\begin_inset ERT\nstatus collapsed\n\\begin_layout %s\n\\backslash\n' % document.default_layout ert_outro='\n\\end_layout\n\n\\end_inset\n\n' math_intro='\n\\begin_inset Formula $' math_outro='$\n\\end_inset\n'