[Libreoffice-commits] core.git: 2 commits - connectivity/source dbaccess/source desktop/source drawinglayer/source

Noel Grandin noel at peralex.com
Mon Apr 25 09:57:45 UTC 2016


 connectivity/source/commontools/propertyids.cxx             |  146 +++++-------
 connectivity/source/inc/propertyids.hxx                     |    6 
 dbaccess/source/core/api/RowSet.cxx                         |    6 
 dbaccess/source/core/api/columnsettings.cxx                 |    6 
 dbaccess/source/core/api/definitioncolumn.cxx               |    6 
 dbaccess/source/core/dataaccess/documentdefinition.cxx      |    8 
 dbaccess/source/core/misc/dsntypes.cxx                      |    6 
 dbaccess/source/core/recovery/dbdocrecovery.cxx             |    8 
 dbaccess/source/ext/macromigration/migrationengine.cxx      |   10 
 dbaccess/source/filter/xml/xmlExport.cxx                    |   34 +-
 dbaccess/source/ui/app/AppController.cxx                    |    8 
 dbaccess/source/ui/app/AppDetailPageHelper.cxx              |   26 +-
 dbaccess/source/ui/app/AppIconControl.cxx                   |    8 
 dbaccess/source/ui/app/AppTitleWindow.cxx                   |   12 
 dbaccess/source/ui/browser/dbloader.cxx                     |    6 
 dbaccess/source/ui/browser/unodatbr.cxx                     |    6 
 dbaccess/source/ui/control/FieldDescControl.cxx             |   36 +-
 dbaccess/source/ui/dlg/queryorder.cxx                       |    8 
 dbaccess/source/ui/misc/DExport.cxx                         |    8 
 dbaccess/source/ui/misc/HtmlReader.cxx                      |   12 
 dbaccess/source/ui/misc/UITools.cxx                         |    4 
 dbaccess/source/ui/misc/WCopyTable.cxx                      |   16 -
 dbaccess/source/ui/querydesign/LimitBox.cxx                 |    5 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx       |    8 
 dbaccess/source/ui/tabledesign/TEditControl.cxx             |    4 
 dbaccess/source/ui/uno/copytablewizard.cxx                  |    6 
 desktop/source/app/dispatchwatcher.cxx                      |    8 
 desktop/source/app/langselect.cxx                           |    3 
 desktop/source/deployment/manager/dp_manager.cxx            |    3 
 desktop/source/deployment/misc/dp_misc.cxx                  |    4 
 desktop/source/deployment/registry/dp_backend.cxx           |    6 
 desktop/source/lib/init.cxx                                 |    4 
 desktop/source/migration/migration.cxx                      |   18 -
 desktop/source/migration/services/oo3extensionmigration.cxx |    8 
 desktop/source/pkgchk/unopkg/unopkg_app.cxx                 |   21 -
 drawinglayer/source/animation/animationtiming.cxx           |   12 
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx     |   12 
 drawinglayer/source/primitive2d/textprimitive2d.cxx         |    4 
 drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx |    3 
 drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx |   16 -
 drawinglayer/source/primitive3d/sdrprimitive3d.cxx          |    4 
 41 files changed, 257 insertions(+), 278 deletions(-)

New commits:
commit d8acc42e5bf83c8864554fb35e9e135b7cba0e87
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 25 11:39:50 2016 +0200

    simplify OPropertyMap init
    
    Change-Id: I4ac86aea7ea391c1c708308b12670005e5eb7d6f

diff --git a/connectivity/source/commontools/propertyids.cxx b/connectivity/source/commontools/propertyids.cxx
index 7acbe46..ca91112 100644
--- a/connectivity/source/commontools/propertyids.cxx
+++ b/connectivity/source/commontools/propertyids.cxx
@@ -22,88 +22,80 @@
 
 namespace dbtools
 {
-        const OUString& OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const
-        {
-            ::std::map<sal_Int32, OUString>::const_iterator aIter = m_aPropertyMap.find(_nIndex);
-            if(aIter == m_aPropertyMap.end())
-            {
-                const_cast<OPropertyMap*>(this)->fillValue(_nIndex);
-                aIter = m_aPropertyMap.find(_nIndex);
-            }
-            return aIter->second;
-        }
+    OPropertyMap::OPropertyMap()
+    {
+        m_aPropertyMap = {
+                {PROPERTY_ID_QUERYTIMEOUT,         "QueryTimeOut"},
+                {PROPERTY_ID_MAXFIELDSIZE,         "MaxFieldSize"},
+                {PROPERTY_ID_MAXROWS,              "MaxRows"},
+                {PROPERTY_ID_CURSORNAME,           "CursorName"},
+                {PROPERTY_ID_RESULTSETCONCURRENCY, "ResultSetConcurrency"},
 
-        void OPropertyMap::fillValue(sal_Int32 _nIndex)
-        {
-            OUString pStr;
-            switch(_nIndex)
-            {
-                case PROPERTY_ID_QUERYTIMEOUT:              pStr = "QueryTimeOut"; break;
-                case PROPERTY_ID_MAXFIELDSIZE:              pStr = "MaxFieldSize"; break;
-                case PROPERTY_ID_MAXROWS:                   pStr = "MaxRows"; break;
-                case PROPERTY_ID_CURSORNAME:                pStr = "CursorName"; break;
-                case PROPERTY_ID_RESULTSETCONCURRENCY:      pStr = "ResultSetConcurrency"; break;
-
-                case PROPERTY_ID_RESULTSETTYPE:             pStr = "ResultSetType"; break;
-                case PROPERTY_ID_FETCHDIRECTION:            pStr = "FetchDirection"; break;
-                case PROPERTY_ID_FETCHSIZE:                 pStr = "FetchSize"; break;
-                case PROPERTY_ID_ESCAPEPROCESSING:          pStr = "EscapeProcessing"; break;
-                case PROPERTY_ID_USEBOOKMARKS:              pStr = "UseBookmarks"; break;
+                {PROPERTY_ID_RESULTSETTYPE,        "ResultSetType"},
+                {PROPERTY_ID_FETCHDIRECTION,       "FetchDirection"},
+                {PROPERTY_ID_FETCHSIZE,            "FetchSize"},
+                {PROPERTY_ID_ESCAPEPROCESSING,     "EscapeProcessing"},
+                {PROPERTY_ID_USEBOOKMARKS,         "UseBookmarks"},
                 // Column
-                case PROPERTY_ID_NAME:                      pStr = "Name"; break;
-                case PROPERTY_ID_TYPE:                      pStr = "Type"; break;
-                case PROPERTY_ID_TYPENAME:                  pStr = "TypeName"; break;
-                case PROPERTY_ID_PRECISION:                 pStr = "Precision"; break;
-                case PROPERTY_ID_SCALE:                     pStr = "Scale"; break;
-                case PROPERTY_ID_ISNULLABLE:                pStr = "IsNullable"; break;
-                case PROPERTY_ID_ISAUTOINCREMENT:           pStr = "IsAutoIncrement"; break;
-                case PROPERTY_ID_ISROWVERSION:              pStr = "IsRowVersion"; break;
-                case PROPERTY_ID_DESCRIPTION:               pStr = "Description"; break;
-                case PROPERTY_ID_DEFAULTVALUE:              pStr = "DefaultValue"; break;
+                {PROPERTY_ID_NAME,                 "Name"},
+                {PROPERTY_ID_TYPE,                 "Type"},
+                {PROPERTY_ID_TYPENAME,             "TypeName"},
+                {PROPERTY_ID_PRECISION,            "Precision"},
+                {PROPERTY_ID_SCALE,                "Scale"},
+                {PROPERTY_ID_ISNULLABLE,           "IsNullable"},
+                {PROPERTY_ID_ISAUTOINCREMENT,      "IsAutoIncrement"},
+                {PROPERTY_ID_ISROWVERSION,         "IsRowVersion"},
+                {PROPERTY_ID_DESCRIPTION,          "Description"},
+                {PROPERTY_ID_DEFAULTVALUE,         "DefaultValue"},
+
+                {PROPERTY_ID_REFERENCEDTABLE,      "ReferencedTable"},
+                {PROPERTY_ID_UPDATERULE,           "UpdateRule"},
+                {PROPERTY_ID_DELETERULE,           "DeleteRule"},
+                {PROPERTY_ID_CATALOG,              "Catalog"},
+                {PROPERTY_ID_ISUNIQUE,             "IsUnique"},
+                {PROPERTY_ID_ISPRIMARYKEYINDEX,    "IsPrimaryKeyIndex"},
+                {PROPERTY_ID_ISCLUSTERED,          "IsClustered"},
+                {PROPERTY_ID_ISASCENDING,          "IsAscending"},
+                {PROPERTY_ID_SCHEMANAME,           "SchemaName"},
+                {PROPERTY_ID_CATALOGNAME,          "CatalogName"},
 
-                case PROPERTY_ID_REFERENCEDTABLE:           pStr = "ReferencedTable"; break;
-                case PROPERTY_ID_UPDATERULE:                pStr = "UpdateRule"; break;
-                case PROPERTY_ID_DELETERULE:                pStr = "DeleteRule"; break;
-                case PROPERTY_ID_CATALOG:                   pStr = "Catalog"; break;
-                case PROPERTY_ID_ISUNIQUE:                  pStr = "IsUnique"; break;
-                case PROPERTY_ID_ISPRIMARYKEYINDEX:         pStr = "IsPrimaryKeyIndex"; break;
-                case PROPERTY_ID_ISCLUSTERED:               pStr = "IsClustered"; break;
-                case PROPERTY_ID_ISASCENDING:               pStr = "IsAscending"; break;
-                case PROPERTY_ID_SCHEMANAME:                pStr = "SchemaName"; break;
-                case PROPERTY_ID_CATALOGNAME:               pStr = "CatalogName"; break;
+                {PROPERTY_ID_COMMAND,              "Command"},
+                {PROPERTY_ID_CHECKOPTION,          "CheckOption"},
+                {PROPERTY_ID_PASSWORD,             "Password"},
+                {PROPERTY_ID_RELATEDCOLUMN,        "RelatedColumn"},
 
-                case PROPERTY_ID_COMMAND:                   pStr = "Command"; break;
-                case PROPERTY_ID_CHECKOPTION:               pStr = "CheckOption"; break;
-                case PROPERTY_ID_PASSWORD:                  pStr = "Password"; break;
-                case PROPERTY_ID_RELATEDCOLUMN:             pStr = "RelatedColumn"; break;
+                {PROPERTY_ID_FUNCTION,             "Function"},
+                {PROPERTY_ID_AGGREGATEFUNCTION,    "AggregateFunction"},
+                {PROPERTY_ID_TABLENAME,            "TableName"},
+                {PROPERTY_ID_REALNAME,             "RealName"},
+                {PROPERTY_ID_DBASEPRECISIONCHANGED,"DbasePrecisionChanged"},
+                {PROPERTY_ID_ISCURRENCY,           "IsCurrency"},
+                {PROPERTY_ID_ISBOOKMARKABLE,       "IsBookmarkable"},
+                {PROPERTY_ID_HY010,                "HY010"}, // error messages
+                {PROPERTY_ID_DELIMITER,            "/"},
+                {PROPERTY_ID_FORMATKEY,            "FormatKey"},
+                {PROPERTY_ID_LOCALE,               "Locale"},
+                {PROPERTY_ID_AUTOINCREMENTCREATION, "AutoIncrementCreation"},
+                {PROPERTY_ID_PRIVILEGES,           "Privileges"},
+                {PROPERTY_ID_HAVINGCLAUSE,         "HavingClause"},
+                {PROPERTY_ID_ISSIGNED,             "IsSigned"},
+                {PROPERTY_ID_ISSEARCHABLE,         "IsSearchable"},
+                {PROPERTY_ID_LABEL,                "Label"},
+                {PROPERTY_ID_APPLYFILTER,          "ApplyFilter"},
+                {PROPERTY_ID_FILTER,               "Filter"},
+                {PROPERTY_ID_MASTERFIELDS,         "MasterFields"},
+                {PROPERTY_ID_DETAILFIELDS,         "DetailFields"},
+                {PROPERTY_ID_FIELDTYPE,            "FieldType"},
+                {PROPERTY_ID_VALUE,                "Value"},
+                {PROPERTY_ID_ACTIVE_CONNECTION,    "ActiveConnection"},
+            };
+    }
 
-                case PROPERTY_ID_FUNCTION:                  pStr = "Function"; break;
-                case PROPERTY_ID_AGGREGATEFUNCTION:         pStr = "AggregateFunction"; break;
-                case PROPERTY_ID_TABLENAME:                 pStr = "TableName"; break;
-                case PROPERTY_ID_REALNAME:                  pStr = "RealName"; break;
-                case PROPERTY_ID_DBASEPRECISIONCHANGED:     pStr = "DbasePrecisionChanged"; break;
-                case PROPERTY_ID_ISCURRENCY:                pStr = "IsCurrency"; break;
-                case PROPERTY_ID_ISBOOKMARKABLE:            pStr = "IsBookmarkable"; break;
-                case PROPERTY_ID_HY010:                     pStr = "HY010"; break; // error messages
-                case PROPERTY_ID_DELIMITER:                 pStr = "/"; break;
-                case PROPERTY_ID_FORMATKEY:                 pStr = "FormatKey"; break;
-                case PROPERTY_ID_LOCALE:                    pStr = "Locale"; break;
-                case PROPERTY_ID_AUTOINCREMENTCREATION:     pStr = "AutoIncrementCreation"; break;
-                case PROPERTY_ID_PRIVILEGES:                pStr = "Privileges"; break;
-                case PROPERTY_ID_HAVINGCLAUSE:              pStr = "HavingClause"; break;
-                case PROPERTY_ID_ISSIGNED:                  pStr = "IsSigned"; break;
-                case PROPERTY_ID_ISSEARCHABLE:              pStr = "IsSearchable"; break;
-                case PROPERTY_ID_LABEL:                     pStr = "Label"; break;
-                case PROPERTY_ID_APPLYFILTER:               pStr = "ApplyFilter"; break;
-                case PROPERTY_ID_FILTER:                    pStr = "Filter"; break;
-                case PROPERTY_ID_MASTERFIELDS:              pStr = "MasterFields"; break;
-                case PROPERTY_ID_DETAILFIELDS:              pStr = "DetailFields"; break;
-                case PROPERTY_ID_FIELDTYPE:                 pStr = "FieldType"; break;
-                case PROPERTY_ID_VALUE:                     pStr = "Value"; break;
-                case PROPERTY_ID_ACTIVE_CONNECTION:         pStr = "ActiveConnection"; break;
-            }
-            m_aPropertyMap[_nIndex] = pStr;
-        }
+    const OUString& OPropertyMap::getNameByIndex(sal_Int32 _nIndex) const
+    {
+        ::std::map<sal_Int32, OUString>::const_iterator aIter = m_aPropertyMap.find(_nIndex);
+        return aIter->second;
+    }
 }
 
 
diff --git a/connectivity/source/inc/propertyids.hxx b/connectivity/source/inc/propertyids.hxx
index a58fee4..409f3c56 100644
--- a/connectivity/source/inc/propertyids.hxx
+++ b/connectivity/source/inc/propertyids.hxx
@@ -31,12 +31,8 @@ namespace dbtools
     class OOO_DLLPUBLIC_DBTOOLS OPropertyMap
     {
         ::std::map<sal_Int32, OUString> m_aPropertyMap;
-
-        void fillValue(sal_Int32 _nIndex);
     public:
-        OPropertyMap()
-        {
-        }
+        OPropertyMap();
         const OUString& getNameByIndex(sal_Int32 _nIndex) const;
     };
 }
commit a5810faae384f7f73e8e835c1f536785a60881d2
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 25 10:56:28 2016 +0200

    clang-tidy modernize-loop-convert in d*
    
    Change-Id: I0830a41b48e884ef63d32b5873c7007195659bb9

diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 42913ce..18a95db 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1746,11 +1746,11 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS
             OUString(PROPERTY_ALIGN), OUString(PROPERTY_RELATIVEPOSITION), OUString(PROPERTY_WIDTH), OUString(PROPERTY_HIDDEN), OUString(PROPERTY_CONTROLMODEL),
             OUString(PROPERTY_HELPTEXT), OUString(PROPERTY_CONTROLDEFAULT)
         };
-        for ( size_t i=0; i<SAL_N_ELEMENTS( aPropertyNames ); ++i )
+        for (const auto & aPropertyName : aPropertyNames)
         {
-            if ( xInfo->hasPropertyByName( aPropertyNames[i] ) )
+            if ( xInfo->hasPropertyByName( aPropertyName ) )
             {
-                _rxRowSetColumn->setPropertyValue( aPropertyNames[i], _rxTemplateColumn->getPropertyValue( aPropertyNames[i] ) );
+                _rxRowSetColumn->setPropertyValue( aPropertyName, _rxTemplateColumn->getPropertyValue( aPropertyName ) );
                 bHaveAnyColumnSetting = true;
             }
         }
diff --git a/dbaccess/source/core/api/columnsettings.cxx b/dbaccess/source/core/api/columnsettings.cxx
index 7449c32..860ed7d 100644
--- a/dbaccess/source/core/api/columnsettings.cxx
+++ b/dbaccess/source/core/api/columnsettings.cxx
@@ -132,10 +132,10 @@ namespace dbaccess
                 { OUString(PROPERTY_HIDDEN),           PROPERTY_ID_HIDDEN }
             };
 
-            for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
+            for (const auto & aProp : aProps)
             {
-                if ( xPSI->hasPropertyByName( aProps[i].sName ) )
-                    if ( !isDefaulted( aProps[i].nHandle, _rxColumn->getPropertyValue( aProps[i].sName ) ) )
+                if ( xPSI->hasPropertyByName( aProp.sName ) )
+                    if ( !isDefaulted( aProp.nHandle, _rxColumn->getPropertyValue( aProp.sName ) ) )
                         return false;
             }
         }
diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx
index 435e995..c8d7e9d 100644
--- a/dbaccess/source/core/api/definitioncolumn.cxx
+++ b/dbaccess/source/core/api/definitioncolumn.cxx
@@ -200,10 +200,10 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co
         { OUString(PROPERTY_TABLENAME),        PROPERTY_ID_TABLENAME },
         { OUString(PROPERTY_REALNAME),         PROPERTY_ID_REALNAME }
     };
-    for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
+    for (const auto & aProp : aProps)
     {
-        if ( xPSI->hasPropertyByName( aProps[i].sName ) )
-            setFastPropertyValue_NoBroadcast( aProps[i].nHandle, _rxParserColumn->getPropertyValue( aProps[i].sName ) );
+        if ( xPSI->hasPropertyByName( aProp.sName ) )
+            setFastPropertyValue_NoBroadcast( aProp.nHandle, _rxParserColumn->getPropertyValue( aProp.sName ) );
     }
 
     // determine the table column we're based on
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 9eefaff..e421a2b 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1476,12 +1476,12 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
     {
         "RecoveryStorage"
     };
-    for ( size_t i=0; i < SAL_N_ELEMENTS( pObjectDescriptorArgs ); ++i )
+    for (const char* pObjectDescriptorArg : pObjectDescriptorArgs)
     {
-        if ( aOpenCommandArguments.has( pObjectDescriptorArgs[i] ) )
+        if ( aOpenCommandArguments.has( pObjectDescriptorArg ) )
         {
-            o_rEmbeddedObjectDescriptor.put( pObjectDescriptorArgs[i], aOpenCommandArguments.get( pObjectDescriptorArgs[i] ) );
-            aOpenCommandArguments.remove( pObjectDescriptorArgs[i] );
+            o_rEmbeddedObjectDescriptor.put( pObjectDescriptorArg, aOpenCommandArguments.get( pObjectDescriptorArg ) );
+            aOpenCommandArguments.remove( pObjectDescriptorArg );
         }
     }
 
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index ebd05ab..87b1606 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -411,11 +411,11 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const OUString& _rDsn) const
         KnownPrefix( "sdbc:address:macab",              DST_MACAB,              true )
     };
 
-    for ( size_t i=0; i < SAL_N_ELEMENTS( aKnowPrefixes ); ++i )
+    for (const auto & aKnowPrefixe : aKnowPrefixes)
     {
-        if( aKnowPrefixes[i].match(sDsn) )
+        if( aKnowPrefixe.match(sDsn) )
         {
-            return aKnowPrefixes[i].eType;
+            return aKnowPrefixe.eType;
         }
     }
 
diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx
index 814a250..b081b63 100644
--- a/dbaccess/source/core/recovery/dbdocrecovery.cxx
+++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx
@@ -291,14 +291,14 @@ namespace dbaccess
         // read the map from sub storages to object names
         MapCompTypeToCompDescs aMapCompDescs;
         const SubComponentType aKnownTypes[] = { TABLE, QUERY, FORM, REPORT, RELATION_DESIGN };
-        for ( size_t i = 0; i < SAL_N_ELEMENTS( aKnownTypes ); ++i )
+        for (SubComponentType aKnownType : aKnownTypes)
         {
-            if ( !xRecoveryStorage->hasByName( SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ) ) )
+            if ( !xRecoveryStorage->hasByName( SubComponentRecovery::getComponentsStorageName( aKnownType ) ) )
                 continue;
 
             Reference< XStorage > xComponentsStor( xRecoveryStorage->openStorageElement(
-                SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ), ElementModes::READ ) );
-            lcl_readObjectMap_throw( m_pData->aContext, xComponentsStor, aMapCompDescs[ aKnownTypes[i] ] );
+                SubComponentRecovery::getComponentsStorageName( aKnownType ), ElementModes::READ ) );
+            lcl_readObjectMap_throw( m_pData->aContext, xComponentsStor, aMapCompDescs[ aKnownType ] );
             xComponentsStor->dispose();
         }
 
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index 5564edc..e2c0992 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -194,11 +194,11 @@ namespace dbmm
                 LanguageMapping( "Python",     ePython ),          // TODO: is this correct?
                 LanguageMapping( "Basic",      eBasic )
             };
-            for ( size_t i=0; i < SAL_N_ELEMENTS( aLanguageMapping ); ++i )
+            for (const LanguageMapping& i : aLanguageMapping)
             {
-                if ( _rLanguage.equalsAscii( aLanguageMapping[i].pAsciiLanguage ) )
+                if ( _rLanguage.equalsAscii( i.pAsciiLanguage ) )
                 {
-                    _out_rScriptType = aLanguageMapping[i].eScriptType;
+                    _out_rScriptType = i.eScriptType;
                     return true;
                 }
             }
@@ -1195,8 +1195,8 @@ namespace dbmm
             const ScriptType aKnownStorageBasedTypes[] = {
                 eBeanShell, eJavaScript, ePython, eJava
             };
-            for ( size_t i=0; i<SAL_N_ELEMENTS( aKnownStorageBasedTypes ); ++i )
-                aElementNames.erase( lcl_getScriptsSubStorageName( aKnownStorageBasedTypes[i] ) );
+            for (ScriptType aKnownStorageBasedType : aKnownStorageBasedTypes)
+                aElementNames.erase( lcl_getScriptsSubStorageName( aKnownStorageBasedType ) );
 
             if ( !aElementNames.empty() )
             {
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 0de7d58..d186399 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -364,14 +364,14 @@ void ODBExport::exportDataSource()
             };
 
             bool bIsXMLDefault = false;
-            for ( size_t i=0; i < SAL_N_ELEMENTS( aTokens ); ++i )
+            for (const auto & aToken : aTokens)
             {
-                if ( pProperties->Name == aTokens[i].sPropertyName )
+                if ( pProperties->Name == aToken.sPropertyName )
                 {
-                    eToken = aTokens[i].eAttributeToken;
+                    eToken = aToken.eAttributeToken;
 
-                    if  (   !!aTokens[i].aXMLDefault
-                        &&  ( sValue == *aTokens[i].aXMLDefault )
+                    if  (   !!aToken.aXMLDefault
+                        &&  ( sValue == *aToken.aXMLDefault )
                         )
                     {
                         bIsXMLDefault = true;
@@ -498,9 +498,9 @@ void ODBExport::exportApplicationConnectionSettings(const TSettingsMap& _aSettin
         ,XML_MAX_ROW_COUNT
         ,XML_SUPPRESS_VERSION_COLUMNS
     };
-    for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
+    for (::xmloff::token::XMLTokenEnum pSetting : pSettings)
     {
-        TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
+        TSettingsMap::const_iterator aFind = _aSettings.find(pSetting);
         if ( aFind != _aSettings.end() )
             AddAttribute(XML_NAMESPACE_DB, aFind->first,aFind->second);
     }
@@ -531,9 +531,9 @@ void ODBExport::exportDriverSettings(const TSettingsMap& _aSettings)
         ,XML_IS_FIRST_ROW_HEADER_LINE
         ,XML_PARAMETER_NAME_SUBSTITUTION
     };
-    for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
+    for (::xmloff::token::XMLTokenEnum pSetting : pSettings)
     {
-        TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
+        TSettingsMap::const_iterator aFind = _aSettings.find(pSetting);
         if ( aFind != _aSettings.end() )
             AddAttribute(XML_NAMESPACE_DB, aFind->first,aFind->second);
     }
@@ -1132,11 +1132,11 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
         };
 
         ::std::vector< XMLPropertyState > aPropertyStates;
-        for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
+        for (const auto & i : pExportHelper)
         {
-            aPropertyStates = pExportHelper[i].first->Filter(_xProp);
+            aPropertyStates = i.first->Filter(_xProp);
             if ( !aPropertyStates.empty() )
-                pExportHelper[i].second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( pExportHelper[i].second.second, aPropertyStates )));
+                i.second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( i.second.second, aPropertyStates )));
         }
 
         Reference< XNameAccess > xCollection;
@@ -1177,14 +1177,14 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
              TExportPropMapperPair(m_xColumnExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XML_STYLE_FAMILY_TABLE_COLUMN ))
             ,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XML_STYLE_FAMILY_TABLE_CELL))
         };
-        for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
+        for (const auto & i : pExportHelper)
         {
-            ::std::vector< XMLPropertyState > aPropStates = pExportHelper[i].first->Filter( _xProp );
+            ::std::vector< XMLPropertyState > aPropStates = i.first->Filter( _xProp );
             if ( !aPropStates.empty() )
             {
                 ::std::vector< XMLPropertyState >::iterator aItr = aPropStates.begin();
                 ::std::vector< XMLPropertyState >::const_iterator aEnd = aPropStates.end();
-                const rtl::Reference < XMLPropertySetMapper >& pStyle = pExportHelper[i].first->getPropertySetMapper();
+                const rtl::Reference < XMLPropertySetMapper >& pStyle = i.first->getPropertySetMapper();
                 while ( aItr != aEnd )
                 {
                     if ( aItr->mnIndex != -1 )
@@ -1208,10 +1208,10 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
                 }
 
             }
-            if ( XML_STYLE_FAMILY_TABLE_CELL == pExportHelper[i].second.second )
+            if ( XML_STYLE_FAMILY_TABLE_CELL == i.second.second )
                 ::std::copy( m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end(), ::std::back_inserter( aPropStates ));
             if ( !aPropStates.empty() )
-                pExportHelper[i].second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( pExportHelper[i].second.second, aPropStates )));
+                i.second.first->insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( i.second.second, aPropStates )));
         }
     }
 }
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 071cbab..d6b9627 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -2646,9 +2646,9 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
     {
         if ( m_xDataSource.is() )
         {
-            for ( size_t i=0; i < SAL_N_ELEMENTS( aPropertyNames ); ++i )
+            for (const auto & aPropertyName : aPropertyNames)
             {
-                m_xDataSource->removePropertyChangeListener( aPropertyNames[i], this );
+                m_xDataSource->removePropertyChangeListener( aPropertyName, this );
             }
         }
 
@@ -2669,9 +2669,9 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
     {
         if ( m_xDataSource.is() )
         {
-            for ( size_t i=0; i < SAL_N_ELEMENTS( aPropertyNames ); ++i )
+            for (const auto & aPropertyName : aPropertyNames)
             {
-                m_xDataSource->addPropertyChangeListener( aPropertyNames[i], this );
+                m_xDataSource->addPropertyChangeListener( aPropertyName, this );
             }
         }
 
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 3c96e67..aaabfb2 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -212,8 +212,8 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo
     m_xWindow = VCLUnoHelper::GetInterface( m_pTablePreview );
 
     SetUniqueId(UID_APP_DETAILPAGE_HELPER);
-    for (int i=0; i < E_ELEMENT_TYPE_COUNT; ++i)
-        m_pLists[i] = nullptr;
+    for (VclPtr<DBTreeListBox> & m_pList : m_pLists)
+        m_pList = nullptr;
     ImplInitSettings();
 }
 
@@ -235,14 +235,14 @@ void OAppDetailPageHelper::dispose()
         OSL_FAIL("Exception thrown while disposing preview frame!");
     }
 
-    for (int i=0; i < E_ELEMENT_TYPE_COUNT; ++i)
+    for (VclPtr<DBTreeListBox> & m_pList : m_pLists)
     {
-        if ( m_pLists[i] )
+        if ( m_pList )
         {
-            m_pLists[i]->clearCurrentSelection();
-            m_pLists[i]->Hide();
-            m_pLists[i]->clearCurrentSelection();   // why a second time?
-            m_pLists[i].disposeAndClear();
+            m_pList->clearCurrentSelection();
+            m_pList->Hide();
+            m_pList->clearCurrentSelection();   // why a second time?
+            m_pList.disposeAndClear();
         }
     }
     m_aMenu.reset();
@@ -764,10 +764,10 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons
 void OAppDetailPageHelper::clearPages()
 {
     showPreview(nullptr);
-    for (size_t i=0; i < E_ELEMENT_TYPE_COUNT; ++i)
+    for (VclPtr<DBTreeListBox> & m_pList : m_pLists)
     {
-        if ( m_pLists[i] )
-            m_pLists[i]->Clear();
+        if ( m_pList )
+            m_pList->Clear();
     }
 }
 
@@ -1156,9 +1156,9 @@ IMPL_LINK_NOARG_TYPED(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, void)
                             , SID_DB_APP_VIEW_DOCINFO_PREVIEW
     };
 
-    for(size_t i=0; i < SAL_N_ELEMENTS(pActions);++i)
+    for(unsigned short pAction : pActions)
     {
-        aMenu->CheckItem(pActions[i],m_aMenu->IsItemChecked(pActions[i]));
+        aMenu->CheckItem(pAction,m_aMenu->IsItemChecked(pAction));
     }
     aMenu->EnableItem( SID_DB_APP_VIEW_DOCINFO_PREVIEW, getBorderWin().getView()->getAppController().isCommandEnabled(SID_DB_APP_VIEW_DOCINFO_PREVIEW) );
 
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx
index d0c0fde..078b224 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -47,13 +47,13 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent)
         { RID_STR_FORMS_CONTAINER,      E_FORM,     IMG_FORMFOLDER_TREE_L   },
         { RID_STR_REPORTS_CONTAINER,    E_REPORT,   IMG_REPORTFOLDER_TREE_L }
     };
-    for ( size_t i=0; i < SAL_N_ELEMENTS(aCategories); ++i)
+    for (const CategoryDescriptor& aCategorie : aCategories)
     {
         SvxIconChoiceCtrlEntry* pEntry = InsertEntry(
-            OUString( ModuleRes( aCategories[i].nLabelResId ) ) ,
-            Image(  ModuleRes( aCategories[i].nImageResId ) ) );
+            OUString( ModuleRes( aCategorie.nLabelResId ) ) ,
+            Image(  ModuleRes( aCategorie.nImageResId ) ) );
         if ( pEntry )
-            pEntry->SetUserData( new ElementType( aCategories[i].eType ) );
+            pEntry->SetUserData( new ElementType( aCategorie.eType ) );
     }
 
     SetChoiceWithCursor();
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index cb2f052..7c89754 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -41,14 +41,14 @@ OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _n
 
     const StyleSettings& rStyle = Application::GetSettings().GetStyleSettings();
     vcl::Window* pWindows[] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get() };
-    for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
+    for (vcl::Window* pWindow : pWindows)
     {
-        vcl::Font aFont = pWindows[i]->GetControlFont();
+        vcl::Font aFont = pWindow->GetControlFont();
         aFont.SetWeight(WEIGHT_BOLD);
-        pWindows[i]->SetControlFont(aFont);
-        pWindows[i]->SetControlForeground(rStyle.GetLightColor());
-        pWindows[i]->SetControlBackground(rStyle.GetShadowColor());
-        pWindows[i]->Show();
+        pWindow->SetControlFont(aFont);
+        pWindow->SetControlForeground(rStyle.GetLightColor());
+        pWindow->SetControlBackground(rStyle.GetShadowColor());
+        pWindow->Show();
     }
 }
 
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index 2d74d33..d8efde5 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -174,12 +174,12 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
     Reference< XController2 > xController;
 
     const OUString sComponentURL( aParser.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
-    for ( size_t i=0; i < SAL_N_ELEMENTS( aImplementations ); ++i )
+    for (const ServiceNameToImplName& aImplementation : aImplementations)
     {
-        if ( sComponentURL.equalsAscii( aImplementations[i].pAsciiServiceName ) )
+        if ( sComponentURL.equalsAscii( aImplementation.pAsciiServiceName ) )
         {
             xController.set( m_xContext->getServiceManager()->
-               createInstanceWithContext( OUString::createFromAscii( aImplementations[i].pAsciiImplementationName ), m_xContext), UNO_QUERY_THROW );
+               createInstanceWithContext( OUString::createFromAscii( aImplementation.pAsciiImplementationName ), m_xContext), UNO_QUERY_THROW );
             break;
         }
     }
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 7005c72..e33ada4 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -542,11 +542,11 @@ bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_f
             OUString(PROPERTY_HAVING_CLAUSE),
             OUString(PROPERTY_ORDER)
         };
-        for (size_t i = 0; i < SAL_N_ELEMENTS(aTransferProperties); ++i)
+        for (const auto & aTransferPropertie : aTransferProperties)
         {
-            if ( !xPSI->hasPropertyByName( aTransferProperties[i] ) )
+            if ( !xPSI->hasPropertyByName( aTransferPropertie ) )
                 continue;
-            aPropertyValues.put( aTransferProperties[i], pData->xObjectProperties->getPropertyValue( aTransferProperties[i] ) );
+            aPropertyValues.put( aTransferPropertie, pData->xObjectProperties->getPropertyValue( aTransferPropertie ) );
         }
 
         ::std::vector< OUString > aNames( aPropertyValues.getNames() );
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 20e1d91..dbd43d7 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -275,8 +275,8 @@ void OFieldDescControl::CheckScrollBars()
     // horizontal :
     long lMaxXPosition = 0;
     Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
-    for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
-        getMaxXPosition(ppAggregates[i],lMaxXPosition);
+    for (Control* ppAggregate : ppAggregates)
+        getMaxXPosition(ppAggregate,lMaxXPosition);
 
     lMaxXPosition += m_pHorzScroll->GetThumbPos() * HSCROLL_STEP;
 
@@ -399,8 +399,8 @@ sal_uInt16 OFieldDescControl::CountActiveAggregates() const
 {
     Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
     sal_uInt16 nVisibleAggregates = 0;
-    for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
-        if (ppAggregates[i])
+    for (Control* pAggregate : ppAggregates)
+        if (pAggregate)
             ++nVisibleAggregates;
     return nVisibleAggregates;
 }
@@ -409,11 +409,11 @@ sal_Int32 OFieldDescControl::GetMaxControlHeight() const
 {
     Size aHeight;
     Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
-    for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
+    for (Control* pAggregate : ppAggregates)
     {
-        if ( ppAggregates[i] )
+        if ( pAggregate )
         {
-            const Size aTemp(ppAggregates[i]->GetOptimalSize());
+            const Size aTemp(pAggregate->GetOptimalSize());
             if ( aTemp.Height() > aHeight.Height() )
                 aHeight.Height() = aTemp.Height();
         }
@@ -662,11 +662,11 @@ void OFieldDescControl::ArrangeAggregates()
     };
 
     long nMaxWidth = 0;
-    for (size_t i=0; i<SAL_N_ELEMENTS(adAggregates); i++)
+    for (const AGGREGATE_DESCRIPTION & adAggregate : adAggregates)
     {
-        if (adAggregates[i].pctrlTextControl)
+        if (adAggregate.pctrlTextControl)
         {
-            nMaxWidth = ::std::max<long>(OutputDevice::GetTextWidth(adAggregates[i].pctrlTextControl->GetText()),nMaxWidth);
+            nMaxWidth = ::std::max<long>(OutputDevice::GetTextWidth(adAggregate.pctrlTextControl->GetText()),nMaxWidth);
         }
     }
 
@@ -675,19 +675,19 @@ void OFieldDescControl::ArrangeAggregates()
     // And go ...
     int nCurrentControlPos = 0;
     Control* pZOrderPredecessor = nullptr;
-    for (size_t i=0; i<SAL_N_ELEMENTS(adAggregates); i++)
+    for (AGGREGATE_DESCRIPTION & adAggregate : adAggregates)
     {
-        if (adAggregates[i].pctrlInputControl)
+        if (adAggregate.pctrlInputControl)
         {
-            SetPosSize(adAggregates[i].pctrlTextControl, nCurrentControlPos, 0);
-            SetPosSize(adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument);
+            SetPosSize(adAggregate.pctrlTextControl, nCurrentControlPos, 0);
+            SetPosSize(adAggregate.pctrlInputControl, nCurrentControlPos, adAggregate.nPosSizeArgument);
 
             // Set the z-order in a way such that the Controls can be traversed in the same sequence in which they have been arranged here
-            adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? ZOrderFlags::Behind : ZOrderFlags::First);
-            adAggregates[i].pctrlInputControl->SetZOrder(adAggregates[i].pctrlTextControl, ZOrderFlags::Behind );
-            pZOrderPredecessor = adAggregates[i].pctrlInputControl;
+            adAggregate.pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? ZOrderFlags::Behind : ZOrderFlags::First);
+            adAggregate.pctrlInputControl->SetZOrder(adAggregate.pctrlTextControl, ZOrderFlags::Behind );
+            pZOrderPredecessor = adAggregate.pctrlInputControl;
 
-            if (adAggregates[i].pctrlInputControl == pFormatSample)
+            if (adAggregate.pctrlInputControl == pFormatSample)
             {
                 pFormat->SetZOrder(pZOrderPredecessor, ZOrderFlags::Behind);
                 pZOrderPredecessor = pFormat;
diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx
index 13fb716..7d7828f 100644
--- a/dbaccess/source/ui/dlg/queryorder.cxx
+++ b/dbaccess/source/ui/dlg/queryorder.cxx
@@ -76,9 +76,9 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent,
     m_aValueList[1] = m_pLB_ORDERVALUE2;
     m_aValueList[2] = m_pLB_ORDERVALUE3;
 
-    for (int j=0; j < DOG_ROWS; ++j)
+    for (VclPtr<ListBox> & j : m_aColumnList)
     {
-        m_aColumnList[j]->InsertEntry( aSTR_NOENTRY );
+        j->InsertEntry( aSTR_NOENTRY );
     }
 
     for (int j=0; j < DOG_ROWS; ++j)
@@ -104,9 +104,9 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent,
                 sal_Int32 eColumnSearch = dbtools::getSearchColumnFlag(m_xConnection,nDataType);
                 if(eColumnSearch != ColumnSearch::NONE)
                 {
-                    for (int j=0; j < DOG_ROWS; ++j)
+                    for (VclPtr<ListBox> & j : m_aColumnList)
                     {
-                        m_aColumnList[j]->InsertEntry(*pIter);
+                        j->InsertEntry(*pIter);
                     }
                 }
             }
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 09740af..d3504b4 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -112,8 +112,8 @@ ODatabaseExport::ODatabaseExport(sal_Int32 nRows,
 {
     m_nRows += nRows;
     sal_Int32 nCount = 0;
-    for(sal_Int32 j=0;j < (sal_Int32)m_vColumns.size();++j)
-        if ( m_vColumns[j].first != COLUMN_POSITION_NOT_FOUND )
+    for(const std::pair<sal_Int32,sal_Int32> & rPair : m_vColumns)
+        if ( rPair.first != COLUMN_POSITION_NOT_FOUND )
             ++nCount;
 
     m_vColumnSize.resize(nCount);
@@ -345,11 +345,11 @@ void ODatabaseExport::insertValueIntoColumn()
                                     ,NumberFormat::NUMBER
                                     ,NumberFormat::LOGICAL
                                 };
-                                for (size_t i = 0; i < SAL_N_ELEMENTS(nFormats); ++i)
+                                for (short nFormat : nFormats)
                                 {
                                     try
                                     {
-                                        nNumberFormat = m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(nFormats[i],m_aLocale),m_sTextToken);
+                                        nNumberFormat = m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(nFormat,m_aLocale),m_sTextToken);
                                         break;
                                     }
                                     catch(Exception&)
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 2cf1497..9442f81 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -134,9 +134,8 @@ void OHTMLReader::NextToken( int nToken )
                 ++m_nTableCount;
                 {   // can also be TD or TH, if there was no TABLE before
                     const HTMLOptions& rHtmlOptions = GetOptions();
-                    for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
+                    for (const auto & rOption : rHtmlOptions)
                     {
-                        const HTMLOption& rOption = rHtmlOptions[i];
                         switch( rOption.GetToken() )
                         {
                             case HTML_O_WIDTH:
@@ -291,9 +290,8 @@ void OHTMLReader::fetchOptions()
 {
     m_bInTbl = true;
     const HTMLOptions& options = GetOptions();
-    for (size_t i = 0, n = options.size(); i < n; ++i)
+    for (const auto & rOption : options)
     {
-        const HTMLOption& rOption = options[i];
         switch( rOption.GetToken() )
         {
             case HTML_O_SDVAL:
@@ -312,9 +310,8 @@ void OHTMLReader::fetchOptions()
 void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal)
 {
     const HTMLOptions& rHtmlOptions = GetOptions();
-    for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
+    for (const auto & rOption : rHtmlOptions)
     {
-        const HTMLOption& rOption = rHtmlOptions[i];
         switch( rOption.GetToken() )
         {
             case HTML_O_ALIGN:
@@ -340,9 +337,8 @@ void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal)
 void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
 {
     const HTMLOptions& rHtmlOptions = GetOptions();
-    for (size_t i = 0, n = rHtmlOptions.size(); i < n; ++i)
+    for (const auto & rOption : rHtmlOptions)
     {
-        const HTMLOption& rOption = rHtmlOptions[i];
         switch( rOption.GetToken() )
         {
         case HTML_O_COLOR:
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index cf4cabd..abde970 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -891,8 +891,8 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
 
     pFormatDescriptor.reset();
     SfxItemPool::Free(pPool);
-    for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
-        delete pDefaults[i];
+    for (SfxPoolItem* pDefault : pDefaults)
+        delete pDefault;
 
     return bRet;
 }
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 169a0b8..44ae24f 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -143,10 +143,10 @@ void ObjectCopySource::copyUISettingsTo( const Reference< XPropertySet >& _rxObj
     const OUString aCopyProperties[] = {
         OUString(PROPERTY_FONT), OUString(PROPERTY_ROW_HEIGHT), OUString(PROPERTY_TEXTCOLOR),OUString(PROPERTY_TEXTLINECOLOR),OUString(PROPERTY_TEXTEMPHASIS),OUString(PROPERTY_TEXTRELIEF)
     };
-    for ( size_t i=0; i < SAL_N_ELEMENTS( aCopyProperties ); ++i )
+    for (const auto & aCopyPropertie : aCopyProperties)
     {
-        if ( m_xObjectPSI->hasPropertyByName( aCopyProperties[i] ) )
-            _rxObject->setPropertyValue( aCopyProperties[i], m_xObject->getPropertyValue( aCopyProperties[i] ) );
+        if ( m_xObjectPSI->hasPropertyByName( aCopyPropertie ) )
+            _rxObject->setPropertyValue( aCopyPropertie, m_xObject->getPropertyValue( aCopyPropertie ) );
     }
 }
 
@@ -165,19 +165,19 @@ void ObjectCopySource::copyFilterAndSortingTo( const Reference< XConnection >& _
 
         OUString sStatement = "SELECT * FROM " + sTargetName + " WHERE 0=1";
 
-        for ( size_t i=0; i < SAL_N_ELEMENTS(aProperties); ++i )
+        for (const std::pair<OUString,OUString> & aPropertie : aProperties)
         {
-            if ( m_xObjectPSI->hasPropertyByName( aProperties[i].first ) )
+            if ( m_xObjectPSI->hasPropertyByName( aPropertie.first ) )
             {
                 OUString sFilter;
-                m_xObject->getPropertyValue( aProperties[i].first ) >>= sFilter;
+                m_xObject->getPropertyValue( aPropertie.first ) >>= sFilter;
                 if ( !sFilter.isEmpty() )
                 {
-                    sStatement += aProperties[i].second;
+                    sStatement += aPropertie.second;
                     OUString sReplace = sFilter;
                     sReplace = sReplace.replaceFirst(sSourceName,sTargetNameTemp);
                     sFilter = sReplace;
-                    _rxObject->setPropertyValue( aProperties[i].first, makeAny(sFilter) );
+                    _rxObject->setPropertyValue( aPropertie.first, makeAny(sFilter) );
                     sStatement += sFilter;
                 }
             }
diff --git a/dbaccess/source/ui/querydesign/LimitBox.cxx b/dbaccess/source/ui/querydesign/LimitBox.cxx
index a5047cf..6575ad1 100644
--- a/dbaccess/source/ui/querydesign/LimitBox.cxx
+++ b/dbaccess/source/ui/querydesign/LimitBox.cxx
@@ -100,10 +100,9 @@ void LimitBox::LoadDefaultLimits()
 {
     InsertValue( ALL_INT );
 
-    const unsigned nSize = SAL_N_ELEMENTS(global::aDefLimitAry);
-    for( unsigned nIndex = 0; nIndex< nSize; ++nIndex)
+    for(long nIndex : global::aDefLimitAry)
     {
-        InsertValue( global::aDefLimitAry[nIndex] );
+        InsertValue( nIndex );
     }
 }
 
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index ed085e4..c5399b9 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -190,10 +190,10 @@ void OSelectionBrowseBox::initialize()
         OUString sGroup = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';') - 1, ';');
         m_aFunctionStrings = m_aFunctionStrings.getToken(0, ';');
 
-        for (size_t i = 0; i < SAL_N_ELEMENTS(eFunctions); ++i)
+        for (IParseContext::InternationalKeyCode eFunction : eFunctions)
         {
             m_aFunctionStrings += ";";
-            m_aFunctionStrings += OStringToOUString(rContext.getIntlKeywordAscii(eFunctions[i]),
+            m_aFunctionStrings += OStringToOUString(rContext.getIntlKeywordAscii(eFunction),
                 RTL_TEXTENCODING_UTF8);
         }
         m_aFunctionStrings += ";";
@@ -341,9 +341,9 @@ void OSelectionBrowseBox::Init()
     Size aHeight;
     const Control* pControls[] = { m_pTextCell,m_pVisibleCell,m_pTableCell,m_pFieldCell };
 
-    for (sal_Size i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+    for (const Control* pControl : pControls)
     {
-        const Size aTemp(pControls[i]->GetOptimalSize());
+        const Size aTemp(pControl->GetOptimalSize());
         if ( aTemp.Height() > aHeight.Height() )
             aHeight.Height() = aTemp.Height();
     }
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 55e8042..c4b4fd6 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -234,9 +234,9 @@ void OTableEditorCtrl::InitCellController()
 
     Size aHeight;
     const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell,pHelpTextCell};
-    for(sal_Size i= 0; i < SAL_N_ELEMENTS(pControls); ++i)
+    for(const Control* pControl : pControls)
     {
-        const Size aTemp(pControls[i]->GetOptimalSize());
+        const Size aTemp(pControl->GetOptimalSize());
         if ( aTemp.Height() > aHeight.Height() )
             aHeight.Height() = aTemp.Height();
     }
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index b708ebc..4f977ea 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -686,11 +686,11 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
     const OUString aSettings[] = {
         OUString(PROPERTY_FILTER), OUString(PROPERTY_ORDER), OUString(PROPERTY_HAVING_CLAUSE), OUString(PROPERTY_GROUP_BY)
     };
-    for ( size_t i=0; i < SAL_N_ELEMENTS( aSettings ); ++i )
+    for (const auto & aSetting : aSettings)
     {
-        if ( lcl_hasNonEmptyStringValue_throw( _rxSourceDescriptor, xPSI, aSettings[i] ) )
+        if ( lcl_hasNonEmptyStringValue_throw( _rxSourceDescriptor, xPSI, aSetting ) )
         {
-            sUnsupportedSetting = aSettings[i];
+            sUnsupportedSetting = aSetting;
             break;
         }
     }
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 257b5a6..bf7ef59 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -676,18 +676,18 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
         aArgs[1].Name = "SynchronMode";
         aArgs[1].Value <<= true;
 
-        for ( size_t n = 0; n < aDispatches.size(); n++ )
+        for (DispatchHolder & aDispatche : aDispatches)
         {
-            Reference< XDispatch > xDispatch = aDispatches[n].xDispatch;
+            Reference< XDispatch > xDispatch = aDispatche.xDispatch;
             Reference < XNotifyingDispatch > xDisp( xDispatch, UNO_QUERY );
             if ( xDisp.is() )
-                xDisp->dispatchWithNotification( aDispatches[n].aURL, aArgs, this );
+                xDisp->dispatchWithNotification( aDispatche.aURL, aArgs, this );
             else
             {
                 ::osl::ClearableMutexGuard aGuard(m_mutex);
                 m_nRequestCount--;
                 aGuard.clear();
-                xDispatch->dispatch( aDispatches[n].aURL, aArgs );
+                xDispatch->dispatch( aDispatche.aURL, aArgs );
             }
         }
     }
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 32240d0..a8309e5 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -61,8 +61,7 @@ OUString getInstalledLocale(
         }
     }
     ::std::vector<OUString> fallbacks( LanguageTag( locale).getFallbackStrings( false));
-    for (size_t f=0; f < fallbacks.size(); ++f) {
-        const OUString& rf = fallbacks[f];
+    for (OUString & rf : fallbacks) {
         for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
             if (installed[i] == rf) {
                 return installed[i];
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 864d852..d86f02a 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -211,9 +211,8 @@ void PackageManagerImpl::initActivationLayer(
             }
 
             bool bShared = (m_context == "shared");
-            for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
+            for (OUString & tempEntry : tempEntries)
             {
-                OUString const & tempEntry = tempEntries[ pos ];
                 const MatchTempDir match( tempEntry );
                 if (::std::none_of( id2temp.begin(), id2temp.end(), match ))
                 {
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index e02b84d..ccf8e96 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -432,8 +432,8 @@ OUString generateRandomPipeId()
         throw RuntimeException( "random pool error!?", nullptr );
     }
     OUStringBuffer buf;
-    for ( sal_uInt32 i = 0; i < ARLEN(bytes); ++i ) {
-        buf.append( static_cast<sal_Int32>(bytes[ i ]), 0x10 );
+    for (unsigned char byte : bytes) {
+        buf.append( static_cast<sal_Int32>(byte), 0x10 );
     }
     return buf.makeStringAndClear();
 }
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 4e3e2ae..a7ca243 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -282,12 +282,12 @@ void PackageRegistryBackend::deleteUnusedFolders(
                     makeURLAppendSysPathSegment(sDataFolder, title));
         }
 
-        for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
+        for (OUString & tempEntrie : tempEntries)
         {
-            if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntries[pos] ) ==
+            if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntrie ) ==
                 usedFolders.end())
             {
-                deleteTempFolder(tempEntries[pos]);
+                deleteTempFolder(tempEntrie);
             }
         }
     }
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ceb7f90..20c48fd5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -783,11 +783,11 @@ static void doc_iniUnoCommands ()
     SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame);
     uno::Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext));
 
-    for (sal_uInt32 nIterator = 0; nIterator < SAL_N_ELEMENTS(sUnoCommands); nIterator++)
+    for (const auto & sUnoCommand : sUnoCommands)
     {
         const SfxSlot* pSlot = nullptr;
 
-        aCommandURL.Complete = sUnoCommands[nIterator];
+        aCommandURL.Complete = sUnoCommand;
         xParser->parseStrict(aCommandURL);
         pSlot = rSlotPool.GetUnoSlot(aCommandURL.Path);
 
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index c2f81bcb..b8e9333 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -241,14 +241,14 @@ bool MigrationImpl::doMigration()
 
         const OUString sMenubarResourceURL("private:resource/menubar/menubar");
         const OUString sToolbarResourcePre("private:resource/toolbar/");
-        for (size_t i=0; i<vModulesInfo.size(); ++i) {
-            OUString sModuleIdentifier = mapModuleShortNameToIdentifier(vModulesInfo[i].sModuleShortName);
+        for (MigrationModuleInfo & i : vModulesInfo) {
+            OUString sModuleIdentifier = mapModuleShortNameToIdentifier(i.sModuleShortName);
             if (sModuleIdentifier.isEmpty())
                 continue;
 
             uno::Sequence< uno::Any > lArgs(2);
             OUString aOldCfgDataPath = m_aInfo.userdata + "/user/config/soffice.cfg/modules/";
-            lArgs[0] <<= aOldCfgDataPath + vModulesInfo[i].sModuleShortName;
+            lArgs[0] <<= aOldCfgDataPath + i.sModuleShortName;
             lArgs[1] <<= embed::ElementModes::READ;
 
             uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
@@ -261,24 +261,24 @@ bool MigrationImpl::doMigration()
                 xOldCfgManager->reload();
             }
 
-            uno::Reference< ui::XUIConfigurationManager > xCfgManager = aNewVersionUIInfo.getConfigManager(vModulesInfo[i].sModuleShortName);
+            uno::Reference< ui::XUIConfigurationManager > xCfgManager = aNewVersionUIInfo.getConfigManager(i.sModuleShortName);
 
-            if (vModulesInfo[i].bHasMenubar) {
+            if (i.bHasMenubar) {
                 uno::Reference< container::XIndexContainer > xOldVersionMenuSettings(xOldCfgManager->getSettings(sMenubarResourceURL, true), uno::UNO_QUERY);
-                uno::Reference< container::XIndexContainer > xNewVersionMenuSettings = aNewVersionUIInfo.getNewMenubarSettings(vModulesInfo[i].sModuleShortName);
+                uno::Reference< container::XIndexContainer > xNewVersionMenuSettings = aNewVersionUIInfo.getNewMenubarSettings(i.sModuleShortName);
                 OUString sParent;
                 compareOldAndNewConfig(sParent, xOldVersionMenuSettings, xNewVersionMenuSettings, sMenubarResourceURL);
                 mergeOldToNewVersion(xCfgManager, xNewVersionMenuSettings, sModuleIdentifier, sMenubarResourceURL);
             }
 
-            sal_Int32 nToolbars = vModulesInfo[i].m_vToolbars.size();
+            sal_Int32 nToolbars = i.m_vToolbars.size();
             if (nToolbars >0) {
                 for (sal_Int32 j=0; j<nToolbars; ++j) {
-                    OUString sToolbarName = vModulesInfo[i].m_vToolbars[j];
+                    OUString sToolbarName = i.m_vToolbars[j];
                     OUString sToolbarResourceURL = sToolbarResourcePre + sToolbarName;
 
                     uno::Reference< container::XIndexContainer > xOldVersionToolbarSettings(xOldCfgManager->getSettings(sToolbarResourceURL, true), uno::UNO_QUERY);
-                    uno::Reference< container::XIndexContainer > xNewVersionToolbarSettings = aNewVersionUIInfo.getNewToolbarSettings(vModulesInfo[i].sModuleShortName, sToolbarName);
+                    uno::Reference< container::XIndexContainer > xNewVersionToolbarSettings = aNewVersionUIInfo.getNewToolbarSettings(i.sModuleShortName, sToolbarName);
                     OUString sParent;
                     compareOldAndNewConfig(sParent, xOldVersionToolbarSettings, xNewVersionToolbarSettings, sToolbarResourceURL);
                     mergeOldToNewVersion(xCfgManager, xNewVersionToolbarSettings, sModuleIdentifier, sToolbarResourceURL);
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 414df39..b8b0677 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -225,9 +225,9 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU
         if ( !aExtIdentifier.isEmpty() )
         {
             // scan extension identifier and try to match with our black list entries
-            for ( size_t i = 0; i < m_aBlackList.size(); i++ )
+            for (OUString & i : m_aBlackList)
             {
-                utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP);
+                utl::SearchParam param(i, utl::SearchParam::SRCH_REGEXP);
                 utl::TextSearch  ts(param, LANGUAGE_DONTKNOW);
 
                 sal_Int32 start = 0;
@@ -250,9 +250,9 @@ bool OO3ExtensionMigration::scanDescriptionXml( const OUString& sDescriptionXmlU
         // Try to use the folder name to match our black list
         // as some extensions don't provide an identifier in the
         // description.xml!
-        for ( size_t i = 0; i < m_aBlackList.size(); i++ )
+        for (OUString & i : m_aBlackList)
         {
-            utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP);
+            utl::SearchParam param(i, utl::SearchParam::SRCH_REGEXP);
             utl::TextSearch  ts(param, LANGUAGE_DONTKNOW);
 
             sal_Int32 start = 0;
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 93fa127..822a1b9 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -364,9 +364,8 @@ extern "C" int unopkg_main()
 
         if ( subcmd_add || subCommand == "remove" )
         {
-            for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos )
+            for (OUString & cmdPackage : cmdPackages)
             {
-                OUString const & cmdPackage = cmdPackages[ pos ];
                 if (subcmd_add)
                 {
                     beans::NamedValue nvSuppress(
@@ -449,18 +448,18 @@ extern "C" int unopkg_main()
             {
                 //The user provided the names (ids or file names) of the extensions
                 //which shall be listed
-                for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos )
+                for (OUString & cmdPackage : cmdPackages)
                 {
                     Reference<deployment::XPackage> extension;
                     try
                     {
                         extension = xExtensionManager->getDeployedExtension(
-                            repository, cmdPackages[ pos ], cmdPackages[ pos ], xCmdEnv );
+                            repository, cmdPackage, cmdPackage, xCmdEnv );
                     }
                     catch (const lang::IllegalArgumentException &)
                     {
                         extension = findPackage(repository,
-                            xExtensionManager, xCmdEnv, cmdPackages[ pos ] );
+                            xExtensionManager, xCmdEnv, cmdPackage );
                     }
 
                     //Now look if the requested extension has an unaccepted license
@@ -470,7 +469,7 @@ extern "C" int unopkg_main()
                         ::std::vector<Reference<deployment::XPackage> >::const_iterator
                             i = ::std::find_if(
                                 vecExtUnaccepted.begin(),
-                                vecExtUnaccepted.end(), ExtensionName(cmdPackages[pos]));
+                                vecExtUnaccepted.end(), ExtensionName(cmdPackage));
                         if (i != vecExtUnaccepted.end())
                         {
                             extension = *i;
@@ -487,7 +486,7 @@ extern "C" int unopkg_main()
                     else
                         throw lang::IllegalArgumentException(
                             "There is no such extension deployed: " +
-                            cmdPackages[pos],nullptr,-1);
+                            cmdPackage,nullptr,-1);
                 }
 
             }
@@ -501,18 +500,18 @@ extern "C" int unopkg_main()
                 vecExtUnaccepted, xExtensionManager->getExtensionsWithUnacceptedLicenses(
                     repository, xCmdEnv));
 
-            for ( ::std::size_t pos = 0; pos < cmdPackages.size(); ++pos )
+            for (OUString & cmdPackage : cmdPackages)
             {
                 Reference<deployment::XPackage> extension;
                 try
                 {
                     extension = xExtensionManager->getDeployedExtension(
-                        repository, cmdPackages[ pos ], cmdPackages[ pos ], xCmdEnv );
+                        repository, cmdPackage, cmdPackage, xCmdEnv );
                 }
                 catch (const lang::IllegalArgumentException &)
                 {
                     extension = findPackage(
-                        repository, xExtensionManager, xCmdEnv, cmdPackages[ pos ] );
+                        repository, xExtensionManager, xCmdEnv, cmdPackage );
                 }
 
                 if (!extension.is())
@@ -520,7 +519,7 @@ extern "C" int unopkg_main()
                     ::std::vector<Reference<deployment::XPackage> >::const_iterator
                         i = ::std::find_if(
                             vecExtUnaccepted.begin(),
-                            vecExtUnaccepted.end(), ExtensionName(cmdPackages[pos]));
+                            vecExtUnaccepted.end(), ExtensionName(cmdPackage));
                     if (i != vecExtUnaccepted.end())
                     {
                         extension = *i;
diff --git a/drawinglayer/source/animation/animationtiming.cxx b/drawinglayer/source/animation/animationtiming.cxx
index fb415b1..3d6b432 100644
--- a/drawinglayer/source/animation/animationtiming.cxx
+++ b/drawinglayer/source/animation/animationtiming.cxx
@@ -178,9 +178,9 @@ namespace drawinglayer
 
         AnimationEntryList::~AnimationEntryList()
         {
-            for(size_t a(0); a < maEntries.size(); a++)
+            for(AnimationEntry* maEntrie : maEntries)
             {
-                delete maEntries[a];
+                delete maEntrie;
             }
         }
 
@@ -188,9 +188,9 @@ namespace drawinglayer
         {
             AnimationEntryList* pNew = new AnimationEntryList();
 
-            for(size_t a(0); a < maEntries.size(); a++)
+            for(AnimationEntry* maEntrie : maEntries)
             {
-                pNew->append(*maEntries[a]);
+                pNew->append(*maEntrie);
             }
 
             return pNew;
@@ -281,9 +281,9 @@ namespace drawinglayer
         {
             AnimationEntryLoop* pNew = new AnimationEntryLoop(mnRepeat);
 
-            for(size_t a(0); a < maEntries.size(); a++)
+            for(AnimationEntry* maEntrie : maEntries)
             {
-                pNew->append(*maEntries[a]);
+                pNew->append(*maEntrie);
             }
 
             return pNew;
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 2687514..094e186 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -602,9 +602,9 @@ namespace
             {
                 std::vector< basegfx::B2DPoint > aPositions(rPositions);
 
-                for(size_t a(0); a < aPositions.size(); a++)
+                for(basegfx::B2DPoint & aPosition : aPositions)
                 {
-                    aPositions[a] = rProperties.getTransformation() * aPositions[a];
+                    aPosition = rProperties.getTransformation() * aPosition;
                 }
 
                 rTarget.append(
@@ -1557,9 +1557,9 @@ namespace
                     // add created text primitive to target
                     if(rProperty.getTransformation().isIdentity())
                     {
-                        for(size_t a(0); a < aTargetVector.size(); a++)
+                        for(drawinglayer::primitive2d::BasePrimitive2D* a : aTargetVector)
                         {
-                            rTarget.append(aTargetVector[a]);
+                            rTarget.append(a);
                         }
                     }
                     else
@@ -2055,9 +2055,9 @@ namespace
                                 {
                                     // when derivation is more than 3,5% from default text size,
                                     // scale the DXArray
-                                    for(size_t a(0); a < aTextArray.size(); a++)
+                                    for(double & a : aTextArray)
                                     {
-                                        aTextArray[a] *= fRelative;
+                                        a *= fRelative;
                                     }
                                 }
                             }
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index ed1a40f..11bbc23 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -127,9 +127,9 @@ namespace drawinglayer
                         ::std::vector< double > aScaledDXArray = getDXArray();
                         const double fDXArrayScale(1.0 / aScale.getX());
 
-                        for(size_t a(0); a < aScaledDXArray.size(); a++)
+                        for(double & a : aScaledDXArray)
                         {
-                            aScaledDXArray[a] *= fDXArrayScale;
+                            a *= fDXArrayScale;
                         }
 
                         // get the text outlines
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index ae60358..489680a2 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -181,9 +181,8 @@ namespace drawinglayer
                                             a2DUnitLine.append(basegfx::B2DPoint(0.0, 0.0));
                                             a2DUnitLine.append(basegfx::B2DPoint(1.0, 0.0));
 
-                                            for(size_t c(0); c < aMatrices.size(); c++)
+                                            for(basegfx::B2DHomMatrix & rMatrix : aMatrices)
                                             {
-                                                const basegfx::B2DHomMatrix& rMatrix = aMatrices[c];
                                                 basegfx::B2DPolygon aNewLine(a2DUnitLine);
                                                 aNewLine.transform(rMatrix);
                                                 a2DHatchLines.append(aNewLine);
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index c75c4fa..bf59398 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -49,9 +49,9 @@ namespace drawinglayer
         {
             basegfx::B3DRange aRetval;
 
-            for(size_t a(0); a < rFill.size(); a++)
+            for(basegfx::B3DPolyPolygon & a : rFill)
             {
-                aRetval.expand(basegfx::tools::getRange(rFill[a]));
+                aRetval.expand(basegfx::tools::getRange(a));
             }
 
             return aRetval;
@@ -62,26 +62,26 @@ namespace drawinglayer
             // create sphere normals
             const basegfx::B3DPoint aCenter(rRange.getCenter());
 
-            for(size_t a(0); a < rFill.size(); a++)
+            for(basegfx::B3DPolyPolygon & a : rFill)
             {
-                rFill[a] = basegfx::tools::applyDefaultNormalsSphere(rFill[a], aCenter);
+                a = basegfx::tools::applyDefaultNormalsSphere(a, aCenter);
             }
         }
 
         void applyNormalsKindFlatTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill)
         {
-            for(size_t a(0); a < rFill.size(); a++)
+            for(basegfx::B3DPolyPolygon & a : rFill)
             {
-                rFill[a].clearNormals();
+                a.clearNormals();
             }
         }
 
         void applyNormalsInvertTo3DGeometry(::std::vector< basegfx::B3DPolyPolygon >& rFill)
         {
             // invert normals
-            for(size_t a(0); a < rFill.size(); a++)
+            for(basegfx::B3DPolyPolygon & a : rFill)
             {
-                rFill[a] = basegfx::tools::invertNormals(rFill[a]);
+                a = basegfx::tools::invertNormals(a);
             }
         }
 
diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
index 0778f87..298b584 100644
--- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
@@ -55,9 +55,9 @@ namespace drawinglayer
 
             if(!rSlices.empty())
             {
-                for(size_t a(0); a < rSlices.size(); a++)
+                for(const auto & rSlice : rSlices)
                 {
-                    aRetval.expand(basegfx::tools::getRange(rSlices[a].getB3DPolyPolygon()));
+                    aRetval.expand(basegfx::tools::getRange(rSlice.getB3DPolyPolygon()));
                 }
 
                 aRetval.transform(getTransform());


More information about the Libreoffice-commits mailing list