diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-12-07 20:40:18 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-12-07 22:23:01 +0100 |
commit | 96829f75aa29411060a60c45f9553be3722b5247 (patch) | |
tree | d6f3ebe944857ff00ff8903c2e7526e03278c493 /l10ntools/source/pocheck.cxx | |
parent | 9536b678c3829c3578ea41e23efdb0319d79288f (diff) |
Replace list by vector in pocheck (l10ntools)
+ use for range loops which included std::list while at it.
Change-Id: If80e63e54f6ba39b38f5de92f97642737727e60a
Reviewed-on: https://gerrit.libreoffice.org/46039
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'l10ntools/source/pocheck.cxx')
-rw-r--r-- | l10ntools/source/pocheck.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx index fbf42689082f..dc56014b083a 100644 --- a/l10ntools/source/pocheck.cxx +++ b/l10ntools/source/pocheck.cxx @@ -9,7 +9,6 @@ #include <iostream> #include <map> -#include <list> #include <vector> #include <rtl/string.hxx> #include <rtl/ustring.hxx> @@ -21,7 +20,7 @@ static void checkStyleNames(const OString& aLanguage) { std::map<OString,sal_uInt16> aLocalizedStyleNames; std::map<OString,sal_uInt16> aLocalizedNumStyleNames; - std::list<PoEntry> repeatedEntries; + std::vector<PoEntry> repeatedEntries; OString aPoPath = OString(getenv("SRC_ROOT")) + "/translations/source/" + @@ -106,8 +105,9 @@ static void checkStyleNames(const OString& aLanguage) aPoInput.readEntry(aPoEntry); if( aPoInput.eof() ) break; - for ( std::list<PoEntry>::iterator it=repeatedEntries.begin(); it!=repeatedEntries.end(); ++it) { - if (it->getMsgId() == aPoEntry.getMsgId() && it->getGroupId() == aPoEntry.getGroupId()) { + for (auto const& repeatedEntry : repeatedEntries) + { + if (repeatedEntry.getMsgId() == aPoEntry.getMsgId() && repeatedEntry.getGroupId() == aPoEntry.getGroupId()) { bError = true; break; } @@ -135,7 +135,7 @@ static void checkFunctionNames(const OString& aLanguage) std::map<OString,sal_uInt16> aLocalizedFunctionNames; std::map<OString,sal_uInt16> aLocalizedCoreFunctionNames; - std::list<PoEntry> repeatedEntries; + std::vector<PoEntry> repeatedEntries; OString aPoPaths[4]; OUString aPoPathURL; @@ -324,9 +324,9 @@ static void checkFunctionNames(const OString& aLanguage) aPoInput.readEntry(aPoEntry); if( aPoInput.eof() ) break; - for ( std::list<PoEntry>::iterator it=repeatedEntries.begin(); it!=repeatedEntries.end(); ++it) + for (auto const& repeatedEntry : repeatedEntries) { - if (it->getMsgId() == aPoEntry.getMsgId() && it->getGroupId() == aPoEntry.getGroupId()) + if (repeatedEntry.getMsgId() == aPoEntry.getMsgId() && repeatedEntry.getGroupId() == aPoEntry.getGroupId()) { bError = true; break; |