]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
FindAdv: Amend ec387b6d: Handle search for '{' and '}'
[lyx.git] / src / Buffer.cpp
index 40c91b8ce9b75c4addbe0f29c23f5d515d6c5eba..01469dbc9065718fa0476c7cef0f770496143e67 100644 (file)
@@ -21,6 +21,7 @@
 #include "BufferParams.h"
 #include "Bullet.h"
 #include "Chktex.h"
+#include "ColorSet.h"
 #include "Converter.h"
 #include "Counters.h"
 #include "Cursor.h"
@@ -1006,7 +1007,7 @@ int Buffer::readHeader(Lexer & lex)
 
        params().shell_escape = theSession().shellescapeFiles().find(absFileName());
 
-       params().makeDocumentClass();
+       params().makeDocumentClass(isClone(), isInternal());
 
        return unknown_tokens;
 }
@@ -1471,7 +1472,7 @@ bool Buffer::save() const
        // proper location once that has been done successfully. that
        // way we preserve the original file if something goes wrong.
        string const justname = fileName().onlyFileNameWithoutExt();
-       auto tempfile = make_unique<TempFile>(fileName().onlyPath(),
+       auto tempfile = lyx::make_unique<TempFile>(fileName().onlyPath(),
                                              justname + "-XXXXXX.lyx");
        bool const symlink = fileName().isSymLink();
        if (!symlink)
@@ -2938,7 +2939,12 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                                undo().recordUndoBufferParams(CursorData());
                                branch_list.add(branch_name);
                                branch = branch_list.find(branch_name);
-                               string const x11hexname = X11hexname(branch->color());
+                               string x11hexname;
+                               string const bcolor = branch->color();
+                               if (bcolor.size() == 7 && bcolor[0] == '#')
+                                       x11hexname = bcolor;
+                               else
+                                       x11hexname = lcolor.getX11HexName(lcolor.getFromLyXName(bcolor));
                                docstring const str = branch_name + ' ' + from_ascii(x11hexname);
                                lyx::dispatch(FuncRequest(LFUN_SET_COLOR, str));
                                dr.setError(false);