diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-14 09:35:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-14 14:17:14 +0200 |
commit | b70fa47aec65fe95da94fc17640dda27650e9677 (patch) | |
tree | 7e54f37342fd57c324f43d54659335554a9c8e72 /unotools/source/config/pathoptions.cxx | |
parent | 6db84250d1c4e7ec5a54ff75e124ea9a84ff89d9 (diff) |
use more SAL_N_ELEMENTS part 1
- teach comphelper::containerToSequence to handle sized arrays
- also use range based for-loop where appropriate.
Change-Id: I73ba9b6295e7b29c872ee53de7a9340969e07f99
Reviewed-on: https://gerrit.libreoffice.org/38769
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools/source/config/pathoptions.cxx')
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 7b42f63b98fe..d6675cd31333 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -416,26 +416,23 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() : } // Create mapping between internal enum (SvtPathOptions::Paths) and property handle - sal_Int32 nCount = sizeof( aPropNames ) / sizeof( PropertyStruct ); - sal_Int32 i; - for ( i = 0; i < nCount; i++ ) + for ( auto const & p : aPropNames ) { NameToHandleMap::const_iterator pIter = - aTempHashMap.find( OUString::createFromAscii( aPropNames[i].pPropName )); + aTempHashMap.find( OUString::createFromAscii( p.pPropName )); if ( pIter != aTempHashMap.end() ) { sal_Int32 nHandle = pIter->second; - sal_Int32 nEnum = aPropNames[i].ePath; + sal_Int32 nEnum = p.ePath; m_aMapEnumToPropHandle.insert( EnumToHandleMap::value_type( nEnum, nHandle )); } } // Create hash map for path variables that need a system path as a return value! - nCount = sizeof( aVarNameAttribute ) / sizeof( VarNameAttribute ); - for ( i = 0; i < nCount; i++ ) + for ( auto const & i : aVarNameAttribute ) { - m_aSystemPathVarNames.insert( OUString::createFromAscii( aVarNameAttribute[i].pVarName ) ); + m_aSystemPathVarNames.insert( OUString::createFromAscii( i.pVarName ) ); } } |