Consider the case where there is not any layout name.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10143 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2005-07-06 19:03:15 +00:00
parent 4a85fd5ed0
commit 7400f85b89
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-07-06 José Matos <jamatos@lyx.org>
* lyx_1_1_5.py (replace_protected_separator): Make it robust
to layout name absence.
2005-07-06 José Matos <jamatos@lyx.org>
* LyX.py (read): Add support for cases where the body begins

View File

@ -33,7 +33,11 @@ def replace_protected_separator(file):
break
j = find_token_backwards(lines, "\\layout", i)
#if j == -1: print error
layout = layout_exp.match(lines[j]).group(1)
layout_m = layout_exp.match(lines[j])
if layout_m:
layout = layout_m.group(1)
else:
layout = "Standard"
if layout == "LyX-Code":
result = ""