On Wed, 2005-04-27 at 12:01, Helge Hafting wrote: ...
> I found that the pagebreak is always lost, but the error message > only happens when the paragraph specifying the break is > double-spaced. When the error message happens, the paragraph > containing the break is also lost. :-( I.e. all I get is the > "after the break" stuff. The file was created with lyx 1.3 > > You can turn off double spacing and notice how the error > message disappear, but the page break is still lost. The > paragraph is not lsot in this case, you'll get "before the break" > followed by "after the break" but no actual break inbetween. > > Helge Hafting I found the reason for the bug. In lyx_1_4.py, the following code: def convert_breaks(file): i = 0 while 1: i = find_token(file.body, "\\begin_layout", i) if i == -1: return i = 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") pb_bot = find(file.body[i],"\\pagebreak_bottom") vspace_top = find(file.body[i],"\\added_space_top") vspace_bot = find(file.body[i],"\\added_space_bottom") if line_top == -1 and line_bot == -1 and pb_bot == -1 and pb_top == -1 and vspace_top == -1 and vspace_bot == -1: continue for tag in "\\line_top", "\\line_bottom", "\\pagebreak_top", "\\pagebreak_bottom": file.body[i] = replace(file.body[i], tag, "") (continues to process the tags...) 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. I know just enough Python to understand that someone else should provide the patch for this :-) -Martin
signature.asc
Description: This is a digitally signed message part