mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Simplify with std::map::insert
This commit is contained in:
parent
11ec1af4fc
commit
dbe35af542
@ -3773,9 +3773,7 @@ void Buffer::Impl::updateMacros(DocIterator & it, DocIterator & scope)
|
||||
|
||||
// register its position, but only when it is
|
||||
// included first in the buffer
|
||||
if (children_positions.find(child) ==
|
||||
children_positions.end())
|
||||
children_positions[child] = it;
|
||||
children_positions.insert({child, it});
|
||||
|
||||
// register child with its scope
|
||||
position_to_children[it] = Impl::ScopeBuffer(scope, child);
|
||||
|
@ -473,11 +473,8 @@ void GuiSymbols::updateSymbolList(bool update_combo)
|
||||
++numItem;
|
||||
if (show_all || (c >= range_start && c <= range_end))
|
||||
s.append(c);
|
||||
if (update_combo) {
|
||||
QString block = getBlock(c);
|
||||
if (used_blocks.find(block) == used_blocks.end())
|
||||
used_blocks[block] = numItem;
|
||||
}
|
||||
if (update_combo)
|
||||
used_blocks.insert({getBlock(c), numItem});
|
||||
}
|
||||
model_->setSymbols(s, enc);
|
||||
|
||||
|
@ -600,8 +600,7 @@ void addArgInsets(Paragraph const & par, string const & prefix,
|
||||
string const name = prefix.empty() ?
|
||||
arg->name() : split(arg->name(), ':');
|
||||
size_t const nr = convert<size_t>(name);
|
||||
if (ilist.find(nr) == ilist.end())
|
||||
ilist[nr] = arg;
|
||||
ilist.insert({nr, arg});
|
||||
Layout::LaTeXArgMap::const_iterator const lit =
|
||||
latexargs.find(arg->name());
|
||||
if (lit != latexargs.end()) {
|
||||
|
@ -445,8 +445,7 @@ int Preamble::getSpecialTableColumnArguments(char c) const
|
||||
void Preamble::add_package(string const & name, vector<string> & options)
|
||||
{
|
||||
// every package inherits the global options
|
||||
if (used_packages.find(name) == used_packages.end())
|
||||
used_packages[name] = split_options(h_options);
|
||||
used_packages.insert({name, split_options(h_options)});
|
||||
|
||||
// Insert options passed via PassOptionsToPackage
|
||||
for (auto const & p : extra_package_options_) {
|
||||
|
Loading…
Reference in New Issue
Block a user