]> git.lyx.org Git - features.git/commitdiff
Fix revert_textcolor method (bug #9620)
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jun 2015 10:48:36 +0000 (12:48 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 13 Jun 2015 10:48:36 +0000 (12:48 +0200)
lib/lyx2lyx/lyx_2_2.py

index c4cac3edfcc8cb992008203250d88fd0b39a4bdb..1895c4e8c57cd7718f5cc363595d3a1ac99c5476 100644 (file)
@@ -1051,7 +1051,6 @@ def revert_textcolor(document):
     i = 0
     j = 0
     xcolor = False
-    add_to_preamble(document, ["\\@ifundefined{rangeHsb}{\\usepackage{xcolor}}"])
     while True:
         i = find_token(document.body, "\\color ", i)
         if i == -1:
@@ -1062,7 +1061,7 @@ def revert_textcolor(document):
                     # register that xcolor must be loaded in the preamble
                     if xcolor == False:
                         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
                     j = find_token(document.body, "\\color", i + 1)
                     k = find_token(document.body, "\\end_layout", i + 1)