Fix revert_textcolor method (bug #9620)

This commit is contained in:
Juergen Spitzmueller 2015-06-13 12:48:36 +02:00
parent f0923ebadc
commit 77fa81a902

View File

@ -1051,7 +1051,6 @@ def revert_textcolor(document):
i = 0 i = 0
j = 0 j = 0
xcolor = False xcolor = False
add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}"])
while True: while True:
i = find_token(document.body, "\\color ", i) i = find_token(document.body, "\\color ", i)
if i == -1: if i == -1:
@ -1062,7 +1061,7 @@ def revert_textcolor(document):
# register that xcolor must be loaded in the preamble # register that xcolor must be loaded in the preamble
if xcolor == False: if xcolor == False:
xcolor = True xcolor = True
add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}"]) add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\usepackage{xcolor}}{}"])
# find the next \\color and/or the next \\end_layout # find the next \\color and/or the next \\end_layout
j = find_token(document.body, "\\color", i + 1) j = find_token(document.body, "\\color", i + 1)
k = find_token(document.body, "\\end_layout", i + 1) k = find_token(document.body, "\\end_layout", i + 1)