range-based loops

This commit is contained in:
Juergen Spitzmueller 2020-08-23 10:07:49 +02:00
parent c3cac2048b
commit 76cdca6422

View File

@ -924,11 +924,9 @@ bool LaTeXFeatures::hasOnlyPolyglossiaLanguages() const
if (params_.language->polyglossia().empty()) if (params_.language->polyglossia().empty())
return false; return false;
// now the secondary languages // now the secondary languages
LanguageList::const_iterator const begin = UsedLanguages_.begin(); for (auto const & lang : UsedLanguages_)
for (LanguageList::const_iterator cit = begin; {
cit != UsedLanguages_.end(); if (lang->polyglossia().empty())
++cit) {
if ((*cit)->polyglossia().empty())
return false; return false;
} }
return true; return true;
@ -941,11 +939,9 @@ bool LaTeXFeatures::hasPolyglossiaExclusiveLanguages() const
if (params_.language->isPolyglossiaExclusive()) if (params_.language->isPolyglossiaExclusive())
return true; return true;
// now the secondary languages // now the secondary languages
LanguageList::const_iterator const begin = UsedLanguages_.begin(); for (auto const & lang : UsedLanguages_)
for (LanguageList::const_iterator cit = begin; {
cit != UsedLanguages_.end(); if (lang->isPolyglossiaExclusive())
++cit) {
if ((*cit)->isPolyglossiaExclusive())
return true; return true;
} }
return false; return false;
@ -959,12 +955,10 @@ vector<string> LaTeXFeatures::getPolyglossiaExclusiveLanguages() const
if (params_.language->isPolyglossiaExclusive()) if (params_.language->isPolyglossiaExclusive())
result.push_back(params_.language->display()); result.push_back(params_.language->display());
// now the secondary languages // now the secondary languages
LanguageList::const_iterator const begin = UsedLanguages_.begin(); for (auto const & lang : UsedLanguages_)
for (LanguageList::const_iterator cit = begin; {
cit != UsedLanguages_.end(); if (lang->isPolyglossiaExclusive())
++cit) { result.push_back(lang->display());
if ((*cit)->isPolyglossiaExclusive())
result.push_back((*cit)->display());
} }
return result; return result;
} }
@ -977,12 +971,10 @@ vector<string> LaTeXFeatures::getBabelExclusiveLanguages() const
if (params_.language->isBabelExclusive()) if (params_.language->isBabelExclusive())
result.push_back(params_.language->display()); result.push_back(params_.language->display());
// now the secondary languages // now the secondary languages
LanguageList::const_iterator const begin = UsedLanguages_.begin(); for (auto const & lang : UsedLanguages_)
for (LanguageList::const_iterator cit = begin; {
cit != UsedLanguages_.end(); if (lang->isBabelExclusive())
++cit) { result.push_back(lang->display());
if ((*cit)->isBabelExclusive())
result.push_back((*cit)->display());
} }
return result; return result;
} }
@ -1010,13 +1002,9 @@ set<string> LaTeXFeatures::getPolyglossiaLanguages() const
{ {
set<string> langs; set<string> langs;
LanguageList::const_iterator const begin = UsedLanguages_.begin(); for (auto const & lang : UsedLanguages_)
for (LanguageList::const_iterator cit = begin;
cit != UsedLanguages_.end();
++cit) {
// We do not need the variants here // We do not need the variants here
langs.insert((*cit)->polyglossia()); langs.insert(lang->polyglossia());
}
return langs; return langs;
} }
@ -1027,10 +1015,8 @@ string LaTeXFeatures::getActiveChars() const
// first the main language // first the main language
res += params_.language->activeChars(); res += params_.language->activeChars();
// now the secondary languages // now the secondary languages
LanguageList::const_iterator const begin = UsedLanguages_.begin(); for (auto const & lang : UsedLanguages_)
for (LanguageList::const_iterator cit = begin; res += (lang->activeChars());
cit != UsedLanguages_.end(); ++cit)
res += ((*cit)->activeChars());
return res; return res;
} }
@ -1062,7 +1048,8 @@ void LaTeXFeatures::getFontEncodings(vector<string> & encs, bool const onlylangs
encs.insert(encs.begin(), "T2A"); encs.insert(encs.begin(), "T2A");
} }
for (auto const & lang : UsedLanguages_) { for (auto const & lang : UsedLanguages_)
{
vector<string> extraencs = vector<string> extraencs =
getVectorFromString(lang->fontenc(buffer().masterParams())); getVectorFromString(lang->fontenc(buffer().masterParams()));
for (auto const & extra : extraencs) { for (auto const & extra : extraencs) {