diff options
Diffstat (limited to 'unotools/source/config')
-rw-r--r-- | unotools/source/config/defaultoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 13 | ||||
-rw-r--r-- | unotools/source/config/saveopt.cxx | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index 47f1ce54e291..c338a741e24c 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -174,7 +174,7 @@ Sequence< OUString > GetDefaultPropertyNames() "Classification" // PATH_CLASSIFICATION }; - const int nCount = sizeof( aPropNames ) / sizeof( const char* ); + const int nCount = SAL_N_ELEMENTS( aPropNames ); Sequence< OUString > aNames( nCount ); OUString* pNames = aNames.getArray(); for ( int i = 0; i < nCount; i++ ) 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 ) ); } } diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 1dff44cee452..7fa55766aa5b 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -375,7 +375,7 @@ Sequence< OUString > GetPropertyNames() "ODF/UseBlowfishInODF12" }; - const int nCount = sizeof( aPropNames ) / sizeof( const char* ); + const int nCount = SAL_N_ELEMENTS( aPropNames ); Sequence< OUString > aNames( nCount ); OUString* pNames = aNames.getArray(); for ( int i = 0; i < nCount; i++ ) |