From 74245321ca6d0ad9eb4686e7fd40cbb83af0f6e8 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 2 Mar 2011 21:46:47 +0000 Subject: [PATCH] Change the passthru conversion routine again. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37833 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/lyx_2_0.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index 7d1b1a7c4c..f5d72db7e7 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -2083,13 +2083,11 @@ def convert_passthru(document): # by new instances of this layout. so we have repeated layouts # instead of newlines. - # first, though, we need to find out if the paragraph has any - # customization, so those can be propogated. - custom = [] - i = beg + 1 - while document.body[i].startswith("\\"): - custom.append(document.body[i]) - i += 1 + # if the paragraph has any customization, however, we do not want to + # do the replacement. + if document.body[beg + 1].startswith("\\"): + beg = end + 1 + continue ns = beg while True: @@ -2103,11 +2101,11 @@ def convert_passthru(document): continue if document.body[ne + 1] == "": ne += 1 - subst = ["\\end_layout", "", "\\begin_layout " + lay] + custom + subst = ["\\end_layout", "", "\\begin_layout " + lay] document.body[ns:ne + 1] = subst # now we need to adjust end, in particular, but might as well # do ns properly, too - newlines = (ne - ns) - len(subst) + len(custom) + newlines = (ne - ns) - len(subst) ns += newlines + 2 end += newlines + 2 -- 2.39.2