]> git.lyx.org Git - features.git/blobdiff - src/Buffer.cpp
Prevent more local colors from leaking (#6626)
[features.git] / src / Buffer.cpp
index 119e26dacdb6939c0f26fa97fb38e1ed20f54fd5..6454ba3c9213ec333988671642768116a84f20af 100644 (file)
@@ -988,7 +988,7 @@ int Buffer::readHeader(Lexer & lex)
                                      << token << '\'');
 
                string const result =
-                       params().readToken(lex, token, d->filename.onlyPath());
+                       params().readToken(lex, token, d->filename);
                if (!result.empty()) {
                        if (token == "\\textclass") {
                                d->layout_position = result;
@@ -2941,16 +2941,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                                undo().recordUndoBufferParams(CursorData());
                                branch_list.add(branch_name);
                                branch = branch_list.find(branch_name);
-                               string x11hexname;
-                               string const bcolor = branch->color();
-                               if (bcolor.size() == 7 && bcolor[0] == '#')
-                                       x11hexname = bcolor;
-                               else {
-                                       bool const darkmode = theApp() ? theApp()->isInDarkMode() : false;
-                                       x11hexname = lcolor.getX11HexName(lcolor.getFromLyXName(bcolor), darkmode);
-                               }
-                               docstring const str = branch_name + ' ' + from_ascii(x11hexname);
-                               lyx::dispatch(FuncRequest(LFUN_SET_COLOR, str));
+                               branch->setColors("background", "background");
                                dr.setError(false);
                                dr.screenUpdate(Update::Force);
                        }