]> git.lyx.org Git - features.git/commitdiff
* BufferParams.cpp: fix initialization of index colors.
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 17 Aug 2009 08:01:35 +0000 (08:01 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 17 Aug 2009 08:01:35 +0000 (08:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31084 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferParams.cpp

index 66dadbee583f65965169df8189b34370ac01bc49..c420ef3ba0b7fcf0bfe1ed2c4bbe4fdca24ad687 100644 (file)
@@ -660,6 +660,7 @@ string BufferParams::readToken(Lexer & lex, string const & token,
        } else if (token == "\\index") {
                lex.eatLine();
                docstring index = lex.getDocString();
+               docstring shortcut;
                indiceslist().add(index);
                while (true) {
                        lex.next();
@@ -669,8 +670,9 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                        Index * index_ptr = indiceslist().find(index);
                        if (tok == "\\shortcut") {
                                lex.next();
+                               shortcut = lex.getDocString();
                                if (index_ptr)
-                                       index_ptr->setShortcut(lex.getDocString());
+                                       index_ptr->setShortcut(shortcut);
                        }
                        // not yet operational
                        if (tok == "\\color") {
@@ -682,7 +684,8 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                                if (color == "none")
                                        color = lcolor.getX11Name(Color_background);
                                // FIXME UNICODE
-                               lcolor.setColor(to_utf8(index), color);
+                               if (!shortcut.empty())
+                                       lcolor.setColor(to_utf8(shortcut), color);
                        }
                }
        } else if (token == "\\author") {