diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-09-27 15:24:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-27 15:47:57 +0200 |
commit | da2e1ea7d4a919a13caf159d1afce13843f7a621 (patch) | |
tree | 0d01165daef419f85750d29695fb6e4bdd3cf3b5 /framework | |
parent | 2c5934b1a10f36525be1220db062d1738b6aac62 (diff) |
Use range-based for
Change-Id: If112967db4828f8570692af5dbbbd9e3c2a837aa
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/substitutepathvars.cxx | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index bc945636b2f1..05324adcd9ae 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -746,12 +746,11 @@ SubstitutePathVariables::SubstitutePathVariables( const Reference< XComponentCon m_aReSubstFixedVarOrder.sort(); // Sort user variables to path length - SubstituteVariables::const_iterator pIter; - for ( pIter = m_aSubstVarMap.begin(); pIter != m_aSubstVarMap.end(); ++pIter ) + for (auto const & i: m_aSubstVarMap) { ReSubstUserVarOrder aUserOrderVar; - aUserOrderVar.aVarName = "$(" + pIter->second.aSubstVariable + ")"; - aUserOrderVar.nVarValueLength = pIter->second.aSubstVariable.getLength(); + aUserOrderVar.aVarName = "$(" + i.second.aSubstVariable + ")"; + aUserOrderVar.nVarValueLength = i.second.aSubstVariable.getLength(); m_aReSubstUserVarOrder.push_back( aUserOrderVar ); } m_aReSubstUserVarOrder.sort(); @@ -1085,18 +1084,16 @@ throw ( RuntimeException ) { bool bVariableFound = false; - for (ReSubstFixedVarOrderVector::const_iterator i( - m_aReSubstFixedVarOrder.begin()); - i != m_aReSubstFixedVarOrder.end(); ++i) + for (auto const & i: m_aReSubstFixedVarOrder) { - OUString aValue = m_aPreDefVars.m_FixedVar[i->eVariable]; + OUString aValue = m_aPreDefVars.m_FixedVar[i.eVariable]; sal_Int32 nPos = aURL.indexOf( aValue ); if ( nPos >= 0 ) { bool bMatch = true; - if ( i->eVariable == PREDEFVAR_USERNAME || - i->eVariable == PREDEFVAR_LANGID || - i->eVariable == PREDEFVAR_VLANG ) + if ( i.eVariable == PREDEFVAR_USERNAME || + i.eVariable == PREDEFVAR_LANGID || + i.eVariable == PREDEFVAR_VLANG ) { // Special path variables as they can occur in the middle of a path. Only match if they // describe a whole directory and not only a substring of a directory! @@ -1123,7 +1120,7 @@ throw ( RuntimeException ) { aURL = aURL.replaceAt( nPos, aValue.getLength(), - m_aPreDefVars.m_FixedVarNames[i->eVariable]); + m_aPreDefVars.m_FixedVarNames[i.eVariable]); bVariableFound = true; // Resubstitution not finished yet! break; } @@ -1131,11 +1128,9 @@ throw ( RuntimeException ) } // This part can be iterated more than one time as variables can contain variables again! - for (ReSubstUserVarOrderVector::const_iterator i( - m_aReSubstUserVarOrder.begin()); - i != m_aReSubstUserVarOrder.end(); ++i) + for (auto const & i: m_aReSubstUserVarOrder) { - OUString aVarValue = i->aVarName; + OUString aVarValue = i.aVarName; sal_Int32 nPos = aURL.indexOf( aVarValue ); if ( nPos >= 0 ) { |