Languages::readLayoutTranslations() clarify and un-indent loop.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39298 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2011-07-14 09:57:59 +00:00
parent fcb2cce53f
commit b9f6712d77

View File

@ -325,22 +325,22 @@ void Languages::readLayoutTranslations(support::FileName const & filename)
if (!lex.next(true)) if (!lex.next(true))
break; break;
string const code = lex.getString(); string const code = lex.getString();
bool readit = false; bool found = false;
for (LanguageList::iterator lit = lbeg; lit != lend; ++lit) { for (LanguageList::iterator lit = lbeg; lit != lend; ++lit) {
if (match(code, lit->second) != NoMatch) { if (match(code, lit->second) != NoMatch) {
if (readTranslations(lex, trans[code])) found = true;
readit = true;
else
lex.printError("Could not read layout "
"translations for language "
"`" + code + "'");
break; break;
} }
} }
if (!readit) { if (!found) {
lex.printError("Unknown language `" + code + "'"); lex.printError("Unknown language `" + code + "'");
break; break;
} }
if (!readTranslations(lex, trans[code])) {
lex.printError("Could not read layout translations for language `"
+ code + "'");
break;
}
} }
// 2) merge all translations into the languages // 2) merge all translations into the languages
@ -349,7 +349,7 @@ void Languages::readLayoutTranslations(support::FileName const & filename)
TransMap::const_iterator const tend = trans.end(); TransMap::const_iterator const tend = trans.end();
for (TransMap::const_iterator tit = tbeg; tit != tend; ++tit) { for (TransMap::const_iterator tit = tbeg; tit != tend; ++tit) {
for (LanguageList::iterator lit = lbeg; lit != lend; ++lit) { for (LanguageList::iterator lit = lbeg; lit != lend; ++lit) {
Match m = match(tit->first, lit->second); Match const m = match(tit->first, lit->second);
if (m == NoMatch) if (m == NoMatch)
continue; continue;
lit->second.readLayoutTranslations(tit->second, lit->second.readLayoutTranslations(tit->second,