Don't need else after return.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34772 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-07-05 22:30:54 +00:00
parent 9211fe72c1
commit d250f9a7c2

View File

@ -279,48 +279,47 @@ def revert_flex_inset(document, name, LaTeXname, position):
i = find_token(document.body, '\\begin_inset Flex ' + name, position) i = find_token(document.body, '\\begin_inset Flex ' + name, position)
if i == -1: if i == -1:
return return
else: z = find_end_of_inset(document.body, i)
z = find_end_of_inset(document.body, i) if z == -1:
if z == -1: document.warning("Malformed LyX document: Can't find end of Flex " + name + " inset.")
document.warning("Malformed LyX document: Can't find end of Flex " + name + " inset.") return
return # remove the \end_inset
# remove the \end_inset document.body[z - 2:z + 1] = put_cmd_in_ert("}")
document.body[z - 2:z + 1] = put_cmd_in_ert("}") # we need to reset character layouts if necessary
# we need to reset character layouts if necessary j = find_token(document.body, '\\emph on', i)
j = find_token(document.body, '\\emph on', i) k = find_token(document.body, '\\noun on', i)
k = find_token(document.body, '\\noun on', i) l = find_token(document.body, '\\series', i)
l = find_token(document.body, '\\series', i) m = find_token(document.body, '\\family', i)
m = find_token(document.body, '\\family', i) n = find_token(document.body, '\\shape', i)
n = find_token(document.body, '\\shape', i) o = find_token(document.body, '\\color', i)
o = find_token(document.body, '\\color', i) p = find_token(document.body, '\\size', i)
p = find_token(document.body, '\\size', i) q = find_token(document.body, '\\bar under', i)
q = find_token(document.body, '\\bar under', i) r = find_token(document.body, '\\uuline on', i)
r = find_token(document.body, '\\uuline on', i) s = find_token(document.body, '\\uwave on', i)
s = find_token(document.body, '\\uwave on', i) t = find_token(document.body, '\\strikeout on', i)
t = find_token(document.body, '\\strikeout on', i) if j != -1 and j < z:
if j != -1 and j < z: document.body.insert(z-2, "\\emph default")
document.body.insert(z-2, "\\emph default") if k != -1 and k < z:
if k != -1 and k < z: document.body.insert(z-2, "\\noun default")
document.body.insert(z-2, "\\noun default") if l != -1 and l < z:
if l != -1 and l < z: document.body.insert(z-2, "\\series default")
document.body.insert(z-2, "\\series default") if m != -1 and m < z:
if m != -1 and m < z: document.body.insert(z-2, "\\family default")
document.body.insert(z-2, "\\family default") if n != -1 and n < z:
if n != -1 and n < z: document.body.insert(z-2, "\\shape default")
document.body.insert(z-2, "\\shape default") if o != -1 and o < z:
if o != -1 and o < z: document.body.insert(z-2, "\\color inherit")
document.body.insert(z-2, "\\color inherit") if p != -1 and p < z:
if p != -1 and p < z: document.body.insert(z-2, "\\size default")
document.body.insert(z-2, "\\size default") if q != -1 and q < z:
if q != -1 and q < z: document.body.insert(z-2, "\\bar default")
document.body.insert(z-2, "\\bar default") if r != -1 and r < z:
if r != -1 and r < z: document.body.insert(z-2, "\\uuline default")
document.body.insert(z-2, "\\uuline default") if s != -1 and s < z:
if s != -1 and s < z: document.body.insert(z-2, "\\uwave default")
document.body.insert(z-2, "\\uwave default") if t != -1 and t < z:
if t != -1 and t < z: document.body.insert(z-2, "\\strikeout default")
document.body.insert(z-2, "\\strikeout default") document.body[i:i+4] = put_cmd_in_ert(LaTeXname + "{")
document.body[i:i+4] = put_cmd_in_ert(LaTeXname + "{")
i += 1 i += 1