diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:27:42 +0200 |
commit | b916407a2a06f8452e82b74dc44c54acbcc572b0 (patch) | |
tree | 46358e0bb035fca0f42edb4b5b8aa5f1613814af /lib/parse_lng.h | |
parent | 5.20 (diff) | |
download | FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.gz FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.tar.bz2 FreeFileSync-b916407a2a06f8452e82b74dc44c54acbcc572b0.zip |
5.21
Diffstat (limited to 'lib/parse_lng.h')
-rw-r--r-- | lib/parse_lng.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/parse_lng.h b/lib/parse_lng.h index be47b66b..9aa62816 100644 --- a/lib/parse_lng.h +++ b/lib/parse_lng.h @@ -107,10 +107,10 @@ public: template <class Function, class Function2> void visitItems(Function onTrans, Function2 onPluralTrans) const //onTrans takes (const TranslationMap::value_type&), onPluralTrans takes (const TranslationPluralMap::value_type&) { - for (auto it = sequence.begin(); it != sequence.end(); ++it) - if (auto regular = dynamic_cast<const RegularItem*>(it->get())) + for (const auto& item : sequence) + if (auto regular = dynamic_cast<const RegularItem*>(item.get())) onTrans(regular->value); - else if (auto plural = dynamic_cast<const PluralItem*>(it->get())) + else if (auto plural = dynamic_cast<const PluralItem*>(item.get())) onPluralTrans(plural->value); else assert(false); } @@ -637,11 +637,10 @@ std::string generateLng(const TranslationUnorderedList& in, const TransHeader& h out += KnownTokens::text(Token::TK_SRC_END) + '\n'; out += KnownTokens::text(Token::TK_TRG_BEGIN); - if (!forms.empty()) out += '\n'; + out += '\n'; - for (PluralForms::const_iterator j = forms.begin(); j != forms.end(); ++j) + for (std::string plForm : forms) { - std::string plForm = *j; formatMultiLineText(plForm); out += KnownTokens::text(Token::TK_PLURAL_BEGIN); |