Fix revert_bibpackopts lyx2lyx routine

This commit is contained in:
Juergen Spitzmueller 2017-01-15 12:48:43 +01:00
parent a53847964d
commit d9f7642bd7

View File

@ -1415,11 +1415,17 @@ def revert_bibpackopts(document):
if engine not in ["natbib", "jurabib"]: if engine not in ["natbib", "jurabib"]:
return return
biblio_options = ""
i = find_token(document.header, "\\biblio_options", 0) i = find_token(document.header, "\\biblio_options", 0)
if i != -1: if i == -1:
biblio_options = get_value(document.header, "\\biblio_options", i) # Nothing to do if we have no options
del document.header[i] return
biblio_options = get_value(document.header, "\\biblio_options", i)
del document.header[i]
if not biblio_options:
# Nothing to do for empty options
return
i = find_token(document.header, "\\begin_local_layout", 0) i = find_token(document.header, "\\begin_local_layout", 0)
if i == -1: if i == -1: