#include "BufferParams.h"
#include "Bullet.h"
#include "Chktex.h"
+#include "ColorSet.h"
#include "Converter.h"
#include "Counters.h"
#include "Cursor.h"
/// whether the bibinfo cache is valid
mutable bool bibinfo_cache_valid_;
+ ///
+ mutable bool need_update;
+
private:
int word_count_;
int char_count_;
internal_buffer(false), read_only(readonly_), file_fully_loaded(false),
need_format_backup(false), ignore_parent(false), macro_lock(false),
externally_modified_(false), bibinfo_cache_valid_(false),
- word_count_(0), char_count_(0), blank_count_(0)
+ need_update(false), word_count_(0), char_count_(0), blank_count_(0)
{
refreshFileMonitor();
if (!cloned_buffer_) {
// The clone needs its own DocumentClass, since running updateBuffer() will
// modify it, and we would otherwise be sharing it with the original Buffer.
buffer_clone->params().makeDocumentClass(true);
- ErrorList el;
cap::switchBetweenClasses(
params().documentClassPtr(), buffer_clone->params().documentClassPtr(),
- static_cast<InsetText &>(buffer_clone->inset()), el);
+ static_cast<InsetText &>(buffer_clone->inset()));
bufmap[this] = buffer_clone;
clones->insert(buffer_clone);
// The clone needs its own DocumentClass, since running updateBuffer() will
// modify it, and we would otherwise be sharing it with the original Buffer.
buffer_clone->params().makeDocumentClass(true);
- ErrorList el;
cap::switchBetweenClasses(
params().documentClassPtr(), buffer_clone->params().documentClassPtr(),
- static_cast<InsetText &>(buffer_clone->inset()), el);
+ static_cast<InsetText &>(buffer_clone->inset()));
clones->insert(buffer_clone);
buffer_clone->d->clone_list_ = clones;
params().fontcolor = RGBColor(0, 0, 0);
params().isfontcolor = false;
params().notefontcolor = RGBColor(0xCC, 0xCC, 0xCC);
+ params().isnotefontcolor = false;
params().boxbgcolor = RGBColor(0xFF, 0, 0);
+ params().isboxbgcolor = false;
params().html_latex_start.clear();
params().html_latex_end.clear();
params().html_math_img_scale = 1.0;
params().biblatex_citestyle.erase();
params().multibib.erase();
params().lineno_opts.clear();
+ params().spellignore().clear();
for (int i = 0; i < 4; ++i) {
params().user_defined_bullet(i) = ITEMIZE_DEFAULTS[i];
<< 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;
// 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)
undo().recordUndoBufferParams(CursorData());
branch_list.add(branch_name);
branch = branch_list.find(branch_name);
- string const x11hexname = X11hexname(branch->color());
- docstring const str = branch_name + ' ' + from_ascii(x11hexname);
- lyx::dispatch(FuncRequest(LFUN_SET_COLOR, str));
+ if (branch)
+ // needed to update the color table for dark mode
+ branch->setColors("background", "background");
dr.setError(false);
dr.screenUpdate(Update::Force);
}
// loop over children
for (auto const & p : d->children_positions) {
Buffer * child = const_cast<Buffer *>(p.first);
+ // This can happen when called during GUI operations
+ if (!theBufferList().isLoaded(child))
+ continue;
// No duplicates
ListOfBuffers::const_iterator bit = find(children.begin(), children.end(), child);
if (bit != children.end())
cbuf.tocBackend().update(true, utype);
if (scope == UpdateMaster)
cbuf.structureChanged();
+
+ d->need_update = false;
}
}
+void Buffer::forceUpdate() const
+{
+ d->need_update = true;
+}
+
+
+bool Buffer::needUpdate() const
+{
+ return d->need_update;
+}
+
+
int Buffer::spellCheck(DocIterator & from, DocIterator & to,
WordLangTuple & word_lang, docstring_list & suggestions) const
{