+ // 1) cheap test, using string comparison of file names
+ for (Buffer * b : bstore)
+ if (b->fileName() == fname)
+ return b;
+ // 2) possibly expensive test, using equivalence test of file names
+ for (Buffer * b : bstore)
+ if (equivalent(b->fileName(), fname))
+ return b;
+ if (internal) {
+ // 1) cheap test, using string comparison of file names
+ for (Buffer * b : binternal)
+ if (b->fileName() == fname)
+ return b;
+ // 2) possibly expensive test, using equivalence test of file names
+ for (Buffer * b : binternal)
+ if (equivalent(b->fileName(), fname))
+ return b;
+ }
+ return nullptr;
+}
+
+
+Buffer * BufferList::getBufferFromTmp(string const & path, bool realpath)
+{
+ for (Buffer * buf : bstore) {
+ string const temppath = realpath ? FileName(buf->temppath()).realPath() : buf->temppath();
+ if (prefixIs(path, temppath)) {
+ // check whether the filename matches the master
+ string const master_name = buf->latexName();
+ if (suffixIs(path, master_name))
+ return buf;
+ // if not, try with the children
+ for (Buffer * child : buf->getDescendants()) {
+ string const mangled_child_name = DocFileName(
+ changeExtension(child->absFileName(),
+ ".tex")).mangledFileName();
+ if (suffixIs(path, mangled_child_name))
+ return child;
+ }
+ }
+ }
+ return nullptr;
+}
+
+
+void BufferList::recordCurrentAuthor(Author const & author)
+{
+ for (Buffer * buf : bstore)
+ buf->params().authors().recordCurrentAuthor(author);
+}
+
+
+void BufferList::updatePreviews()
+{
+ for (Buffer * buf : bstore)
+ buf->updatePreviews();