]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
more cursor dispatch
[lyx.git] / src / bufferparams.C
index bbe6c3009040e5240e794095983ad899343db9c6..0f119fe5731b17ae4706c195b7e08afb92146062 100644 (file)
 #include "gettext.h"
 #include "language.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
+#include "LColor.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "lyxtextclasslist.h"
+#include "outputparams.h"
 #include "tex-strings.h"
 #include "Spacing.h"
 #include "texrow.h"
@@ -48,7 +49,7 @@ using lyx::support::rtrim;
 using lyx::support::tokenPos;
 
 using std::endl;
-
+using std::string;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -332,20 +333,22 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                        string const tok = lex.getString();
                        if (tok == "\\end_branch")
                                break;
+                       Branch * branch_ptr = branchlist().find(branch);
                        if (tok == "\\selected") {
                                lex.nextToken();
-                               branchlist().setSelected(branch, lex.getInteger());
+                               if (branch_ptr)
+                                       branch_ptr->setSelected(lex.getInteger());
                        }
                        // not yet operational
                        if (tok == "\\color") {
                                lex.nextToken();
                                string color = lex.getString();
-                               branchlist().setColor(branch, color);
+                               if (branch_ptr)
+                                       branch_ptr->setColor(color);
                                // Update also the LColor table:
                                if (color == "none")
                                        color = lcolor.getX11Name(LColor::background);
-                               lcolor.fill(static_cast<LColor::color>(lcolor.size()),
-                                               branch, color);
+                               lcolor.setColor(lcolor.getFromLyXName(branch), color);
                        }
                }
        } else if (token == "\\author") {