Fix thinko in convert_corollary_args

Fixes: #9478
This commit is contained in:
Juergen Spitzmueller 2015-03-24 21:43:25 +01:00
parent a6bc4a2a34
commit d98618c7db
2 changed files with 8 additions and 6 deletions

View File

@ -2461,22 +2461,22 @@ def convert_corollary_args(document):
document.body[parbeg] = "\\begin_inset Argument 1"
elif document.body[ertcontlastline].endswith("]"):
# divide the args
ertcontdivline = document.body[ertcontfirstline].find('>[')
if ertcontdivline != -1:
tok = document.body[ertcontfirstline].find('>[')
if tok != -1:
if ertcontfirstline < ertcontlastline:
# Multiline ERT. Might contain TeX code. Embrace in ERT.
document.body[ertcontlastline : ertcontlastline + 1] = [
document.body[ertcontlastline], '\\end_layout', '', '\\end_inset']
document.body[ertcontdivline : ertcontdivline + 1] = [document.body[ertcontdivline][:tok],
document.body[ertcontfirstline : ertcontfirstline + 1] = [document.body[ertcontfirstline][:tok],
'\\end_layout', '', '\\end_inset', '', '', '\\begin_inset Argument 2',
'status collapsed', '', '\\begin_layout Plain Layout',
'\\begin_inset ERT', '', 'status open' '', '\\begin_layout Plain Layout',
document.body[ertcontdivline][tok + 2:]]
document.body[ertcontfirstline][tok + 2:-1]]
else:
document.body[ertcontdivline : ertcontdivline + 1] = [document.body[ertcontdivline][:tok],
document.body[ertcontfirstline : ertcontfirstline + 1] = [document.body[ertcontfirstline][:tok],
'\\end_layout', '', '\\end_inset', '', '', '\\begin_inset Argument 2',
'status collapsed', '', '\\begin_layout Plain Layout',
document.body[ertcontdivline][tok + 2:]]
document.body[ertcontfirstline][tok + 2:-1]]
# Convert to ArgInset
document.body[parbeg] = "\\begin_inset Argument 1"
i = j

View File

@ -104,6 +104,8 @@ What's new
- Fix conversion of beamer block arguments where the overlay argument and the
closing title argument bracket share the same ERT (bug 9411).
- Fix conversion of beamer colloraries with argument (bug 9478).
- Fix handling of the TEXINPUTS environment variable on Windows (bug 9453).