Fix more unintended copies in range-based for loops

Spotted by g++ 11.
This commit is contained in:
Jean-Marc Lasgouttes 2021-10-15 17:41:01 +02:00
parent cca4b8d42a
commit 09b340a45e
4 changed files with 4 additions and 4 deletions

View File

@ -267,7 +267,7 @@ vector<char_type> Encoding::symbolsList() const
// add all encodable characters
copy(encodable_.begin(), encodable_.end(), back_inserter(symbols));
// now the ones from the unicodesymbols file that are not already there
for (pair<char_type, CharInfo> const & elem : unicodesymbols) {
for (pair<const char_type, CharInfo> const & elem : unicodesymbols) {
if (find(symbols.begin(), symbols.end(), elem.first) == symbols.end())
symbols.push_back(elem.first);
}

View File

@ -272,7 +272,7 @@ void TocBackend::resetOutlinerNames()
{
outliner_names_.clear();
// names from this document class
for (pair<string, docstring> const & name
for (pair<const string, docstring> const & name
: buffer_->params().documentClass().outlinerNames())
addName(name.first, translateIfPossible(name.second));
// Hardcoded types

View File

@ -353,7 +353,7 @@ void TocModels::reset(BufferView const * bv)
names_->insertColumns(0, 1);
// In the outliner, add Tocs from the master document
TocBackend const & backend = bv->buffer().masterBuffer()->tocBackend();
for (pair<string, shared_ptr<Toc>> const & toc : backend.tocs()) {
for (pair<const string, shared_ptr<Toc>> const & toc : backend.tocs()) {
QString const type = toqstr(toc.first);
// First, fill in the toc models.

View File

@ -1288,7 +1288,7 @@ void InsetInclude::addToToc(DocIterator const & cpit, bool output_active,
//Copy missing outliner names (though the user has been warned against
//having different document class and module selection between master
//and child).
for (pair<string, docstring> const & name
for (pair<const string, docstring> const & name
: childbuffer->params().documentClass().outlinerNames())
backend.addName(name.first, translateIfPossible(name.second));
}