Create accssors authodmap() in BufferParams.
Use [] operator instead of find().
Hopefully this will avoid to confuse Coverity scan.
Impl();
AuthorList authorlist;
+ AuthorMap authormap;
BranchList branchlist;
WordLangTable spellignore;
Bullet temp_bullets[4];
use_lineno = false;
// map current author
- author_map_[pimpl_->authorlist.get(0).bufferId()] = 0;
+ pimpl_->authormap[pimpl_->authorlist.get(0).bufferId()] = 0;
}
}
+BufferParams::AuthorMap & BufferParams::authormap()
+{
+ return pimpl_->authormap;
+}
+
+
+BufferParams::AuthorMap const & BufferParams::authormap() const
+{
+ return pimpl_->authormap;
+}
+
+
void BufferParams::addAuthor(Author const & a)
{
- author_map_[a.bufferId()] = pimpl_->authorlist.record(a);
+ pimpl_->authormap[a.bufferId()] = pimpl_->authorlist.record(a);
}
/// map of the file's author IDs to AuthorList indexes
typedef std::map<int, int> AuthorMap;
- AuthorMap author_map_;
+ AuthorMap & authormap();
+ AuthorMap const & authormap() const;
/// the buffer's active font encoding
std::string const main_font_encoding() const;
int aid;
time_t ct;
is >> aid >> ct;
- BufferParams::AuthorMap const & am = bp.author_map_;
+ BufferParams::AuthorMap & am = bp.authormap();
if (am.find(aid) == am.end()) {
errorList.push_back(ErrorItem(
_("Change tracking author index missing"),
bp.addAuthor(Author(aid));
}
if (token == "\\change_inserted")
- change = Change(Change::INSERTED, am.find(aid)->second, ct);
+ change = Change(Change::INSERTED, am[aid], ct);
else
- change = Change(Change::DELETED, am.find(aid)->second, ct);
+ change = Change(Change::DELETED, am[aid], ct);
} else {
lex.eatLine();
errorList.push_back(ErrorItem(_("Unknown token"),
"is incomplete. I will ignore this."));
return false;
}
- BufferParams::AuthorMap const & am = bp.author_map_;
+ BufferParams::AuthorMap & am = bp.authormap();
int aid = convert<int>(changedata[1]);
if (am.find(aid) == am.end()) {
// FIXME Use ErrorList
time_t ct;
is >> ct;
if (changedata[0] == "inserted") {
- change = Change(Change::INSERTED, am.find(aid)->second, ct);
+ change = Change(Change::INSERTED, am[aid], ct);
return true;
} else if (changedata[0] == "deleted") {
- change = Change(Change::DELETED, am.find(aid)->second, ct);
+ change = Change(Change::DELETED, am[aid], ct);
return true;
}
}