]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Fix bug #6284: missing space between # and text in math mode when using \mbox
[lyx.git] / src / BufferParams.cpp
index 66dadbee583f65965169df8189b34370ac01bc49..f369c8d6d9cbdf03d67c3cf520ec2c45edc3a5ce 100644 (file)
@@ -644,7 +644,6 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                                if (branch_ptr)
                                        branch_ptr->setFilenameSuffix(lex.getInteger());
                        }
-                       // not yet operational
                        if (tok == "\\color") {
                                lex.eatLine();
                                string color = lex.getString();
@@ -660,6 +659,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,10 +669,10 @@ 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") {
                                lex.eatLine();
                                string color = lex.getString();
@@ -682,7 +682,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") {