On Wednesday 27 April 2005 14:59, Martin Vermeer wrote: > > Do you spot the error? This code expects to find the \pagebreak_bottom > on the line immediately following the \begin_layout. If it doesn't find > it there, it proceeds immediately to the next \begin_layout! Of course > instead, it should just test the next line within *this* layout. There > is a loop missing.
Bah, I don't like loops especially if I can avoid them. So the easier solution was simply to remove the need for such loop. > I know just enough Python to understand that someone else should provide > the patch for this :-) The attached patch fixes that. At the same time I noticed that we lake the ability to revert this change. I will give it some thought. > -Martin -- Josà AbÃlio
Index: lyx_1_4.py =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx_1_4.py,v retrieving revision 1.29 diff -u -p -r1.29 lyx_1_4.py --- lyx_1_4.py 26 Apr 2005 15:45:51 -0000 1.29 +++ lyx_1_4.py 4 May 2005 11:16:57 -0000 @@ -524,6 +524,12 @@ def convert_breaks(file): if i == -1: return i = i + 1 + + # Merge all paragraph parameters into a single line + while file.body[i + 1][:1] == '\\': + file.body[i] = file.body[i + 1] + ' ' + file.body[i] + del file.body[i+1] + line_top = find(file.body[i],"\\line_top") line_bot = find(file.body[i],"\\line_bottom") pb_top = find(file.body[i],"\\pagebreak_top")