fix lyx2lyx paragraph parameter conversion

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9951 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2005-05-18 14:50:29 +00:00
parent 621ea9c5c7
commit 5179c52e66
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-05-18 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* lyx_1_4.py (convert_breaks): Don't treat every token that starts
with '\\' as paragraph parameter
2005-05-06 José Matos <jamatos@lyx.org>
* lyx_1_4.py (convert_breaks): put all paragraph parameters into a single line.

View File

@ -518,6 +518,10 @@ def revert_end_document(file):
#
#\end_layout
def convert_breaks(file):
par_params = ('added_space_bottom', 'added_space_top', 'align',
'labelwidthstring', 'line_bottom', 'line_top', 'noindent',
'pagebreak_bottom', 'pagebreak_top', 'paragraph_spacing',
'start_of_appendix')
i = 0
while 1:
i = find_token(file.body, "\\begin_layout", i)
@ -526,7 +530,9 @@ def convert_breaks(file):
i = i + 1
# Merge all paragraph parameters into a single line
while file.body[i + 1][:1] == '\\':
# We cannot check for '\\' only because paragraphs may start e.g.
# with '\\backslash'
while file.body[i + 1][:1] == '\\' and split(file.body[i + 1][1:])[0] in par_params:
file.body[i] = file.body[i + 1] + ' ' + file.body[i]
del file.body[i+1]