namespace {
-int const LYX_FORMAT = 271;
+int const LYX_FORMAT = 276;
} // namespace anon
///
TocBackend toc_backend;
+
+ /// Container for all sort of Buffer dependant errors.
+ map<string, ErrorList> errorLists;
};
params().temp_bullet(i) = ITEMIZE_DEFAULTS[i];
}
- ErrorList & errorList = errorLists_["Parse"];
+ ErrorList & errorList = pimpl_->errorLists["Parse"];
while (lex.isOK()) {
lex.next();
// Returns false if "\end_document" is not read (Asger)
bool Buffer::readDocument(Lexer & lex)
{
- ErrorList & errorList = errorLists_["Parse"];
+ ErrorList & errorList = pimpl_->errorLists["Parse"];
errorList.clear();
lex.next();
<< "\\lyxformat " << LYX_FORMAT << "\n"
<< "\\begin_document\n";
+
+ /// For each author, set 'used' to true if there is a change
+ /// by this author in the document; otherwise set it to 'false'.
+ AuthorList::Authors::const_iterator a_it = params().authors().begin();
+ AuthorList::Authors::const_iterator a_end = params().authors().end();
+ for (; a_it != a_end; ++a_it)
+ a_it->second.used(false);
+
+ ParIterator const end = par_iterator_end();
+ ParIterator it = par_iterator_begin();
+ for ( ; it != end; ++it)
+ it->checkAuthors(params().authors());
+
// now write out the buffer parameters.
ofs << "\\begin_header\n";
params().writeFile(ofs);
Alert::error(_("chktex failure"),
_("Could not run chktex successfully."));
} else if (res > 0) {
- ErrorList & errorList = errorLists_["ChkTeX"];
+ ErrorList & errorList = pimpl_->errorLists["ChkTeX"];
// Clear out old errors
errorList.clear();
// Fill-in the error list with the TeX errors
void Buffer::setParentName(string const & name)
{
- params().parentname = name;
+ if (name == pimpl_->filename.absFilename())
+ // Avoids recursive include.
+ params().parentname.clear();
+ else
+ params().parentname = name;
}
ErrorList const & Buffer::errorList(string const & type) const
{
static ErrorList const emptyErrorList;
- std::map<string, ErrorList>::const_iterator I = errorLists_.find(type);
- if (I == errorLists_.end())
+ std::map<string, ErrorList>::const_iterator I = pimpl_->errorLists.find(type);
+ if (I == pimpl_->errorLists.end())
return emptyErrorList;
return I->second;
ErrorList & Buffer::errorList(string const & type)
{
- return errorLists_[type];
+ return pimpl_->errorLists[type];
}