From: Georg Baum Date: Wed, 18 May 2005 14:50:29 +0000 (+0000) Subject: fix lyx2lyx paragraph parameter conversion X-Git-Tag: 1.6.10~14284 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5179c52e66ca34079d290ce8c6754e0ecfb7e965;p=features.git fix lyx2lyx paragraph parameter conversion git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9951 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index 724013af47..48525fe827 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,8 @@ +2005-05-18 Georg Baum + + * lyx_1_4.py (convert_breaks): Don't treat every token that starts + with '\\' as paragraph parameter + 2005-05-06 José Matos * lyx_1_4.py (convert_breaks): put all paragraph parameters into a single line. diff --git a/lib/lyx2lyx/lyx_1_4.py b/lib/lyx2lyx/lyx_1_4.py index eb0c91edba..da34801612 100644 --- a/lib/lyx2lyx/lyx_1_4.py +++ b/lib/lyx2lyx/lyx_1_4.py @@ -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]