Kaydet (Commit) 96829f75 authored tarafından Julien Nabet's avatar Julien Nabet

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/46039Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 9536b678
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment