mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Fix revert_textcolor method (bug #9620)
This commit is contained in:
parent
f0923ebadc
commit
77fa81a902
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user