diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-09 15:22:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-09 16:14:30 +0200 |
commit | 555ee51b77a789253bffdd9ffb16bdc5e51b980a (patch) | |
tree | 501abf83f3825ed790bd66f92c15026dd27c2221 /codemaker/source/cppumaker/includes.cxx | |
parent | a6f16879922ee237db268ad19328009242b3ca6d (diff) |
convert to range-based for loops in codemaker/
Change-Id: Ifa521f34a8d9565bb61743c4a996bcba37e95ec2
Diffstat (limited to 'codemaker/source/cppumaker/includes.cxx')
-rw-r--r-- | codemaker/source/cppumaker/includes.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx index 22c783085558..d1a9f2b65318 100644 --- a/codemaker/source/cppumaker/includes.cxx +++ b/codemaker/source/cppumaker/includes.cxx @@ -100,10 +100,9 @@ void Includes::add(OString const & entityName) { m_includeAny = true; break; case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: - for (std::vector< OString >::iterator i(args.begin()); i != args.end(); - ++i) + for (const OString& arg : args) { - add(*i); + add(arg); } // fall through case codemaker::UnoType::SORT_SEQUENCE_TYPE: @@ -137,10 +136,9 @@ void dumpEmptyLineBeforeFirst(FileStream & out, bool * first) { void Includes::dump(FileStream & out, OUString const * companionHdl) { OSL_ASSERT(companionHdl == nullptr || m_hpp); if (!m_includeReference) { - for (Dependencies::Map::iterator i(m_map.begin()); i != m_map.end(); - ++i) + for (const std::pair<OUString, codemaker::cppumaker::Dependencies::Kind>& pair : m_map) { - if (isInterfaceType(u2b(i->first))) { + if (isInterfaceType(u2b(pair.first))) { m_includeReference = true; break; } @@ -161,25 +159,25 @@ void Includes::dump(FileStream & out, OUString const * companionHdl) { dumpInclude(out, u2b(*companionHdl), false); } bool first = true; - for (Dependencies::Map::iterator i(m_map.begin()); i != m_map.end(); ++i) + for (const std::pair<OUString, codemaker::cppumaker::Dependencies::Kind>& pair : m_map) { dumpEmptyLineBeforeFirst(out, &first); - if (m_hpp || i->second == Dependencies::KIND_BASE - || !isInterfaceType(u2b(i->first))) + if (m_hpp || pair.second == Dependencies::KIND_BASE + || !isInterfaceType(u2b(pair.first))) { - dumpInclude(out, u2b(i->first), m_hpp); + dumpInclude(out, u2b(pair.first), m_hpp); } else { - bool ns = dumpNamespaceOpen(out, i->first, false); + bool ns = dumpNamespaceOpen(out, pair.first, false); if (ns) { out << " "; } out << "class "; - dumpTypeIdentifier(out, i->first); + dumpTypeIdentifier(out, pair.first); out << ";"; if (ns) { out << " "; } - dumpNamespaceClose(out, i->first, false); + dumpNamespaceClose(out, pair.first, false); out << "\n"; } } |