mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Fix bug #10917, and some for loops.
This commit is contained in:
parent
c67eed8ccb
commit
9326edbd1b
@ -831,7 +831,7 @@ vector<string> LaTeXFeatures::getBabelExclusiveLanguages() const
|
|||||||
|
|
||||||
string LaTeXFeatures::getBabelLanguages() const
|
string LaTeXFeatures::getBabelLanguages() const
|
||||||
{
|
{
|
||||||
ostringstream languages;
|
ostringstream langs;
|
||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
LanguageList::const_iterator const begin = UsedLanguages_.begin();
|
LanguageList::const_iterator const begin = UsedLanguages_.begin();
|
||||||
@ -841,27 +841,27 @@ string LaTeXFeatures::getBabelLanguages() const
|
|||||||
if ((*cit)->babel().empty())
|
if ((*cit)->babel().empty())
|
||||||
continue;
|
continue;
|
||||||
if (!first)
|
if (!first)
|
||||||
languages << ',';
|
langs << ',';
|
||||||
else
|
else
|
||||||
first = false;
|
first = false;
|
||||||
languages << (*cit)->babel();
|
langs << (*cit)->babel();
|
||||||
}
|
}
|
||||||
return languages.str();
|
return langs.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
set<string> LaTeXFeatures::getPolyglossiaLanguages() const
|
set<string> LaTeXFeatures::getPolyglossiaLanguages() const
|
||||||
{
|
{
|
||||||
set<string> languages;
|
set<string> langs;
|
||||||
|
|
||||||
LanguageList::const_iterator const begin = UsedLanguages_.begin();
|
LanguageList::const_iterator const begin = UsedLanguages_.begin();
|
||||||
for (LanguageList::const_iterator cit = begin;
|
for (LanguageList::const_iterator cit = begin;
|
||||||
cit != UsedLanguages_.end();
|
cit != UsedLanguages_.end();
|
||||||
++cit) {
|
++cit) {
|
||||||
// We do not need the variants here
|
// We do not need the variants here
|
||||||
languages.insert((*cit)->polyglossia());
|
langs.insert((*cit)->polyglossia());
|
||||||
}
|
}
|
||||||
return languages;
|
return langs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -870,39 +870,34 @@ set<string> LaTeXFeatures::getEncodingSet(string const & doc_encoding) const
|
|||||||
// This does only find encodings of languages supported by babel, but
|
// This does only find encodings of languages supported by babel, but
|
||||||
// that does not matter since we don't have a language with an
|
// that does not matter since we don't have a language with an
|
||||||
// encoding supported by inputenc but without babel support.
|
// encoding supported by inputenc but without babel support.
|
||||||
set<string> encodings;
|
set<string> encs;
|
||||||
LanguageList::const_iterator it = UsedLanguages_.begin();
|
for (auto const & lang : UsedLanguages_)
|
||||||
LanguageList::const_iterator end = UsedLanguages_.end();
|
if (lang->encoding()->latexName() != doc_encoding &&
|
||||||
for (; it != end; ++it)
|
(lang->encoding()->package() == Encoding::inputenc
|
||||||
if ((*it)->encoding()->latexName() != doc_encoding &&
|
|| lang->encoding()->package() == Encoding::japanese))
|
||||||
((*it)->encoding()->package() == Encoding::inputenc
|
encs.insert(lang->encoding()->latexName());
|
||||||
|| (*it)->encoding()->package() == Encoding::japanese))
|
return encs;
|
||||||
encodings.insert((*it)->encoding()->latexName());
|
|
||||||
return encodings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LaTeXFeatures::getFontEncodings(vector<string> & encodings) const
|
void LaTeXFeatures::getFontEncodings(vector<string> & encs) const
|
||||||
{
|
{
|
||||||
// these must be loaded if glyphs of this script are used
|
// these must be loaded if glyphs of this script are used
|
||||||
// unless a language providing them is used in the document
|
// unless a language providing them is used in the document
|
||||||
if (mustProvide("textgreek")
|
if (mustProvide("textgreek")
|
||||||
&& find(encodings.begin(), encodings.end(), "LGR") == encodings.end())
|
&& find(encs.begin(), encs.end(), "LGR") == encs.end())
|
||||||
encodings.insert(encodings.begin(), "LGR");
|
encs.insert(encs.begin(), "LGR");
|
||||||
if (mustProvide("textcyr")
|
if (mustProvide("textcyr")
|
||||||
&& find(encodings.begin(), encodings.end(), "T2A") == encodings.end())
|
&& find(encs.begin(), encs.end(), "T2A") == encs.end())
|
||||||
encodings.insert(encodings.begin(), "T2A");
|
encs.insert(encs.begin(), "T2A");
|
||||||
|
|
||||||
LanguageList::const_iterator it = UsedLanguages_.begin();
|
for (auto const & lang : UsedLanguages_)
|
||||||
LanguageList::const_iterator end = UsedLanguages_.end();
|
if (!lang->fontenc().empty()
|
||||||
for (; it != end; ++it)
|
&& ascii_lowercase(lang->fontenc()) != "none") {
|
||||||
if (!(*it)->fontenc().empty()
|
vector<string> extraencs = getVectorFromString(lang->fontenc());
|
||||||
&& ascii_lowercase((*it)->fontenc()) != "none") {
|
for (auto const & extra : extraencs) {
|
||||||
vector<string> extraencs = getVectorFromString((*it)->fontenc());
|
if (find(encs.begin(), encs.end(), extra) == encs.end())
|
||||||
vector<string>::const_iterator fit = extraencs.begin();
|
encs.insert(encs.begin(), extra);
|
||||||
for (; fit != extraencs.end(); ++fit) {
|
|
||||||
if (find(encodings.begin(), encodings.end(), *fit) == encodings.end())
|
|
||||||
encodings.insert(encodings.begin(), *fit);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user