[Libreoffice-commits] core.git: oox/source

Julien Nabet serval2412 at yahoo.fr
Sat Mar 31 11:25:49 UTC 2018


 oox/source/drawingml/fillproperties.cxx        |    6 +-
 oox/source/drawingml/shape.cxx                 |    8 +--
 oox/source/drawingml/textbody.cxx              |    8 ++-
 oox/source/drawingml/textliststyle.cxx         |    8 +--
 oox/source/dump/dffdumper.cxx                  |   16 +++---
 oox/source/dump/dumperbase.cxx                 |   58 +++++++++++++++----------
 oox/source/dump/oledumper.cxx                  |   56 +++++++++++++-----------
 oox/source/export/chartexport.cxx              |   14 ++----
 oox/source/export/drawingml.cxx                |    6 +-
 oox/source/export/vmlexport.cxx                |   36 +++++++--------
 oox/source/helper/binaryinputstream.cxx        |    4 -
 oox/source/helper/propertymap.cxx              |   35 ++++++++-------
 oox/source/helper/storagebase.cxx              |    4 -
 oox/source/ole/axbinaryreader.cxx              |   16 +++++-
 oox/source/ole/axbinarywriter.cxx              |   16 +++++-
 oox/source/ole/axcontrol.cxx                   |    8 +--
 oox/source/ole/vbacontrol.cxx                  |   35 ++++++---------
 oox/source/ole/vbaproject.cxx                  |   18 +++----
 oox/source/ppt/animationspersist.cxx           |    5 --
 oox/source/ppt/comments.cxx                    |   21 ++++-----
 oox/source/ppt/pptshapegroupcontext.cxx        |    9 +--
 oox/source/ppt/presentationfragmenthandler.cxx |   28 ++++--------
 oox/source/ppt/slidefragmenthandler.cxx        |   12 ++---
 oox/source/ppt/slidepersist.cxx                |   32 +++++--------
 oox/source/ppt/timenode.cxx                    |    7 +--
 oox/source/shape/ShapeContextHandler.cxx       |    4 -
 oox/source/token/tokenmap.cxx                  |    5 +-
 oox/source/vml/vmlinputstream.cxx              |    4 -
 oox/source/vml/vmlshape.cxx                    |   10 ++--
 oox/source/vml/vmlshapecontainer.cxx           |   18 +++----
 oox/source/vml/vmltextbox.cxx                  |   12 ++---
 31 files changed, 270 insertions(+), 249 deletions(-)

New commits:
commit 0d06d1d16775fde3b0b34f3374907e07cbba763d
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Mar 31 12:17:55 2018 +0200

    Use for-range loops in oox (part2)
    
    Change-Id: I7cbeb67a1adcdb9b0003e22b61789a882fc336c9
    Reviewed-on: https://gerrit.libreoffice.org/52182
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 944a4dbee05d..d7a87d2735ea 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -785,10 +785,10 @@ css::beans::PropertyValue ArtisticEffectProperties::getEffect()
 
     css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() + 1 );
     sal_uInt32 i = 0;
-    for( std::map< OUString, css::uno::Any >::iterator it = maAttribs.begin(); it != maAttribs.end(); ++it )
+    for (auto const& attrib : maAttribs)
     {
-        aSeq[i].Name = it->first;
-        aSeq[i].Value = it->second;
+        aSeq[i].Name = attrib.first;
+        aSeq[i].Value = attrib.second;
         i++;
     }
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 5593e9656e9b..9f92e7e7eecd 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -386,10 +386,10 @@ void Shape::addChildren(
              << aChildTransformation.get(2, 1) << " "
              << aChildTransformation.get(2, 2));
 
-    std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
-    while( aIter != rMaster.maChildren.end() ) {
-        (*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
-        (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), pShapeMap );
+    for (auto const& child : rMaster.maChildren)
+    {
+        child->setMasterTextListStyle( mpMasterTextListStyle );
+        child->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), pShapeMap );
     }
 }
 
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index 9c8fcb6e5783..43efe6c3989b 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -67,8 +67,12 @@ void TextBody::insertAt(
 
     Reference<css::beans::XPropertySet> xPropertySet(xAt, UNO_QUERY);
     float nCharHeight = xPropertySet->getPropertyValue("CharHeight").get<float>();
-    for( TextParagraphVector::const_iterator aBeg = maParagraphs.begin(), aIt = aBeg, aEnd = maParagraphs.end(); aIt != aEnd; ++aIt )
-        (*aIt)->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, aIt == aBeg, nCharHeight );
+    size_t nIndex = 0;
+    for (auto const& paragraph : maParagraphs)
+    {
+        paragraph->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, (nIndex == 0), nCharHeight );
+        ++nIndex;
+    }
 }
 
 bool TextBody::isEmpty() const
diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx
index ee387387f0a8..bd2599335a32 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -64,18 +64,16 @@ TextListStyle& TextListStyle::operator=(const TextListStyle& rStyle)
 
 void applyStyleList( const TextParagraphPropertiesVector& rSourceListStyle, TextParagraphPropertiesVector& rDestListStyle )
 {
-    TextParagraphPropertiesVector::const_iterator aSourceListStyleIter( rSourceListStyle.begin() );
     TextParagraphPropertiesVector::iterator aDestListStyleIter( rDestListStyle.begin() );
-    while( aSourceListStyleIter != rSourceListStyle.end() )
+    for (auto const& elemSource : rSourceListStyle)
     {
         if ( aDestListStyleIter != rDestListStyle.end() )
         {
-            (*aDestListStyleIter)->apply( **aSourceListStyleIter );
+            (*aDestListStyleIter)->apply(*elemSource);
             ++aDestListStyleIter;
         }
         else
-            rDestListStyle.push_back( std::make_shared<TextParagraphProperties>( **aSourceListStyleIter ) );
-        ++aSourceListStyleIter;
+            rDestListStyle.push_back( std::make_shared<TextParagraphProperties>(*elemSource) );
     }
 }
 
diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx
index 9bd3617b0d05..8cf2c9ee207d 100644
--- a/oox/source/dump/dffdumper.cxx
+++ b/oox/source/dump/dffdumper.cxx
@@ -194,26 +194,28 @@ void DffStreamObject::dumpDffOpt()
     }
 
     mxOut->resetItemIndex();
-    for( PropInfoVector::iterator aIt = aPropInfos.begin(), aEnd = aPropInfos.end(); !mxStrm->isEof() && (aIt != aEnd); ++aIt )
+    for (auto const& propInfo : aPropInfos)
     {
+        if (mxStrm->isEof())
+            break;
         mxOut->startMultiItems();
         writeEmptyItem( "#complex-data" );
-        writeHexItem( "id", aIt->mnId, "DFFOPT-PROPERTY-NAMES" );
+        writeHexItem( "id", propInfo.mnId, "DFFOPT-PROPERTY-NAMES" );
         mxOut->endMultiItems();
         IndentGuard aIndent( mxOut );
-        switch( aIt->meType )
+        switch(propInfo.meType)
         {
             case PROPTYPE_BINARY:
-                dumpBinary( aIt->maName, aIt->mnSize );
+                dumpBinary( propInfo.maName, propInfo.mnSize );
             break;
             case PROPTYPE_STRING:
-                dumpUnicodeArray( aIt->maName, aIt->mnSize / 2, true );
+                dumpUnicodeArray( propInfo.maName, propInfo.mnSize / 2, true );
             break;
             case PROPTYPE_BLIP:
-                dumpBinary( aIt->maName, aIt->mnSize );
+                dumpBinary( propInfo.maName, propInfo.mnSize );
             break;
             case PROPTYPE_COLORARRAY:
-                dumpBinary( aIt->maName, aIt->mnSize );
+                dumpBinary( propInfo.maName, propInfo.mnSize );
             break;
         }
     }
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index e54fb9d11c7e..2a66f0eaf51f 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -872,8 +872,8 @@ void NameListBase::includeList( const NameListRef& rxList )
 {
     if( rxList.get() )
     {
-        for( const_iterator aIt = rxList->begin(), aEnd = rxList->end(); aIt != aEnd; ++aIt )
-            maMap[ aIt->first ] = aIt->second;
+        for (auto const& elem : *rxList)
+            maMap[ elem.first ] = elem.second;
         implIncludeList( *rxList );
     }
 }
@@ -915,23 +915,25 @@ void NameListBase::include( const OUString& rListKeys )
 {
     OUStringVector aVec;
     StringHelper::convertStringToStringList( aVec, rListKeys, true );
-    for( OUStringVector::const_iterator aIt = aVec.begin(), aEnd = aVec.end(); aIt != aEnd; ++aIt )
-        includeList( mrCfgData.getNameList( *aIt ) );
+    for (auto const& elem : aVec)
+        includeList( mrCfgData.getNameList(elem) );
 }
 
 void NameListBase::exclude( const OUString& rKeys )
 {
     Int64Vector aVec;
     StringHelper::convertStringToIntList( aVec, rKeys, true );
-    for( Int64Vector::const_iterator aIt = aVec.begin(), aEnd = aVec.end(); aIt != aEnd; ++aIt )
-        maMap.erase( *aIt );
+    for (auto const& elem : aVec)
+        maMap.erase(elem);
 }
 
 void ItemFormatMap::insertFormats( const NameListRef& rxNameList )
 {
     if( Base::isValid( rxNameList ) )
-        for( NameListBase::const_iterator aIt = rxNameList->begin(), aEnd = rxNameList->end(); aIt != aEnd; ++aIt )
-            maMap[ aIt->first ].parse( aIt->second );
+    {
+        for (auto const& elemName : *rxNameList)
+            maMap[ elemName.first ].parse( elemName.second );
+    }
 }
 
 ConstList::ConstList( const SharedConfigData& rCfgData ) :
@@ -993,9 +995,12 @@ MultiList::MultiList( const SharedConfigData& rCfgData ) :
 void MultiList::setNamesFromVec( sal_Int64 nStartKey, const OUStringVector& rNames )
 {
     sal_Int64 nKey = nStartKey;
-    for( OUStringVector::const_iterator aIt = rNames.begin(), aEnd = rNames.end(); aIt != aEnd; ++aIt, ++nKey )
-        if( !mbIgnoreEmpty || !aIt->isEmpty() )
-            insertRawName( nKey, *aIt );
+    for (auto const& name : rNames)
+    {
+        if( !mbIgnoreEmpty || !name.isEmpty() )
+            insertRawName( nKey, name);
+        ++nKey;
+    }
 }
 
 void MultiList::implProcessConfigItemStr(
@@ -1119,13 +1124,12 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName )
 {
     if( (nKey & (nKey - 1)) != 0 )  // more than a single bit set?
     {
-        typedef ::std::set< ExtItemFormatKey > ExtItemFormatKeySet;
         ::std::set< ExtItemFormatKey > aItemKeys;
         ExtItemFormat aItemFmt;
         OUStringVector aRemain = aItemFmt.parse( rName );
-        for( OUStringVector::iterator aIt = aRemain.begin(), aEnd = aRemain.end(); aIt != aEnd; ++aIt )
+        for (auto const& elemRemain : aRemain)
         {
-            OUStringPair aPair = StringHelper::convertStringToPair( *aIt );
+            OUStringPair aPair = StringHelper::convertStringToPair(elemRemain);
             if ( aPair.first == "noshift" )
             {
                 aItemFmt.mbShiftValue = StringHelper::convertStringToBool( aPair.second );
@@ -1145,8 +1149,8 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName )
         }
         if( aItemKeys.empty() )
             aItemKeys.insert( ExtItemFormatKey( nKey ) );
-        for( ExtItemFormatKeySet::iterator aIt = aItemKeys.begin(), aEnd = aItemKeys.end(); aIt != aEnd; ++aIt )
-            maFmtMap[ *aIt ] = aItemFmt;
+        for (auto const& itemKey : aItemKeys)
+            maFmtMap[itemKey] = aItemFmt;
     }
     else
     {
@@ -1159,13 +1163,13 @@ OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const
     sal_Int64 nFound = 0;
     OUStringBuffer aName;
     // add known flag fields
-    for( ExtItemFormatMap::const_iterator aIt = maFmtMap.begin(), aEnd = maFmtMap.end(); aIt != aEnd; ++aIt )
+    for (auto const& fmt : maFmtMap)
     {
-        const ExtItemFormatKey& rMapKey = aIt->first;
+        const ExtItemFormatKey& rMapKey = fmt.first;
         sal_Int64 nMask = rMapKey.mnKey;
         if( (nMask != 0) && ((nKey & rMapKey.maFilter.first) == rMapKey.maFilter.second) )
         {
-            const ExtItemFormat& rItemFmt = aIt->second;
+            const ExtItemFormat& rItemFmt = fmt.second;
 
             sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nKey );
             sal_uInt64 nUMask = static_cast< sal_uInt64 >( nMask );
@@ -1877,8 +1881,10 @@ void StorageObjectBase::extractStorage( const StorageRef& rxStrg, const OUString
 
     // process preferred storages and streams in root storage first
     if( rStrgPath.isEmpty() )
-        for( PreferredItemVector::iterator aIt = maPreferred.begin(), aEnd = maPreferred.end(); aIt != aEnd; ++aIt )
-            extractItem( rxStrg, rStrgPath, aIt->maName, rSysPath, aIt->mbStorage, !aIt->mbStorage );
+    {
+        for (auto const& elemPreferred : maPreferred)
+            extractItem( rxStrg, rStrgPath, elemPreferred.maName, rSysPath, elemPreferred.mbStorage, !elemPreferred.mbStorage );
+    }
 
     // process children of the storage
     for( StorageIterator aIt( rxStrg ); aIt.isValid(); ++aIt )
@@ -1887,8 +1893,14 @@ void StorageObjectBase::extractStorage( const StorageRef& rxStrg, const OUString
         OUString aItemName = aIt.getName();
         bool bFound = false;
         if( rStrgPath.isEmpty() )
-            for( PreferredItemVector::iterator aIIt = maPreferred.begin(), aIEnd = maPreferred.end(); !bFound && (aIIt != aIEnd); ++aIIt )
-                bFound = aIIt->maName == aItemName;
+        {
+            for (auto const& elemPreferred : maPreferred)
+            {
+                bFound = elemPreferred.maName == aItemName;
+                if (bFound)
+                    break;
+            }
+        }
         if( !bFound )
             extractItem( rxStrg, rStrgPath, aItemName, rSysPath, aIt.isStorage(), aIt.isStream() );
     }
diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx
index 20d4ab7793e5..c878267eb8ad 100644
--- a/oox/source/dump/oledumper.cxx
+++ b/oox/source/dump/oledumper.cxx
@@ -281,8 +281,8 @@ void OlePropertyStreamObject::dumpSection( const OUString& rGuid, sal_uInt32 nSt
     }
 
     // other properties
-    for( PropertyPosMap::const_iterator aIt = aPropMap.begin(), aEnd = aPropMap.end(); aIt != aEnd; ++aIt )
-        dumpProperty( aIt->first, aIt->second );
+    for (auto const& elem : aPropMap)
+        dumpProperty( elem.first, elem.second );
 
     // remove the user defined list of property ID names
     cfg().eraseNameList( "OLEPROP-IDS" );
@@ -1067,14 +1067,16 @@ void AxPropertyObjectBase::dumpLargeProperties()
     {
         writeEmptyItem( "large-properties" );
         IndentGuard aIndGuard( mxOut );
-        for( LargePropertyVector::iterator aIt = maLargeProps.begin(), aEnd = maLargeProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
+        for (auto const& largeProp : maLargeProps)
         {
-            switch( aIt->mePropType )
+            if (!ensureValid())
+                break;
+            switch( largeProp.mePropType )
             {
                 case LargeProperty::PROPTYPE_POS:
                 {
                     MultiItemsGuard aMultiGuard( mxOut );
-                    writeEmptyItem( aIt->maItemName );
+                    writeEmptyItem( largeProp.maItemName );
                     dumpDec< sal_Int32 >( "top", "CONV-HMM-TO-CM" );
                     dumpDec< sal_Int32 >( "left", "CONV-HMM-TO-CM" );
                 }
@@ -1082,31 +1084,31 @@ void AxPropertyObjectBase::dumpLargeProperties()
                 case LargeProperty::PROPTYPE_SIZE:
                 {
                     MultiItemsGuard aMultiGuard( mxOut );
-                    writeEmptyItem( aIt->maItemName );
+                    writeEmptyItem( largeProp.maItemName );
                     dumpDec< sal_Int32 >( "width", "CONV-HMM-TO-CM" );
                     dumpDec< sal_Int32 >( "height", "CONV-HMM-TO-CM" );
                 }
                 break;
                 case LargeProperty::PROPTYPE_GUID:
                 {
-                    OUString aGuid = dumpGuid( aIt->maItemName );
-                    if( aIt->mpItemValue )
-                        *aIt->mpItemValue = cfg().getStringOption( aGuid, OUString() );
+                    OUString aGuid = dumpGuid( largeProp.maItemName );
+                    if( largeProp.mpItemValue )
+                        *largeProp.mpItemValue = cfg().getStringOption( aGuid, OUString() );
                 }
                 break;
                 case LargeProperty::PROPTYPE_STRING:
                 {
-                    OUString aString = dumpString( aIt->maItemName, aIt->mnDataSize, false );
-                    if( aIt->mpItemValue )
-                        *aIt->mpItemValue = aString;
+                    OUString aString = dumpString( largeProp.maItemName, largeProp.mnDataSize, false );
+                    if( largeProp.mpItemValue )
+                        *largeProp.mpItemValue = aString;
                 }
                 break;
                 case LargeProperty::PROPTYPE_STRINGARRAY:
                 {
-                    writeEmptyItem( aIt->maItemName );
+                    writeEmptyItem( largeProp.maItemName );
                     IndentGuard aIndGuard2( mxOut );
                     mxOut->resetItemIndex();
-                    sal_Int64 nEndPos = mxStrm->tell() + aIt->mnDataSize;
+                    sal_Int64 nEndPos = mxStrm->tell() + largeProp.mnDataSize;
                     while( mxStrm->tell() < nEndPos )
                     {
                         MultiItemsGuard aMultiGuard( mxOut );
@@ -1125,10 +1127,12 @@ void AxPropertyObjectBase::dumpLargeProperties()
     {
         writeEmptyItem( "stream-properties" );
         IndentGuard aIndGuard( mxOut );
-        for( StreamPropertyVector::iterator aIt = maStreamProps.begin(), aEnd = maStreamProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
+        for (auto const& streamProp : maStreamProps)
         {
-            writeEmptyItem( aIt->maItemName );
-            if( ensureValid( aIt->mnData == 0xFFFF ) )
+            if (!ensureValid())
+                break;
+            writeEmptyItem( streamProp.maItemName );
+            if( ensureValid( streamProp.mnData == 0xFFFF ) )
             {
                 IndentGuard aIndGuard2( mxOut );
                 OUString aClassName = cfg().getStringOption( dumpGuid(), OUString() );
@@ -1720,16 +1724,18 @@ VbaOStreamObject::VbaOStreamObject( const ObjectBase& rParent,
 
 void VbaOStreamObject::implDump()
 {
-    for( VbaFormSiteInfoVector::iterator aIt = mrFormData.maSiteInfos.begin(), aEnd = mrFormData.maSiteInfos.end(); !mxStrm->isEof() && (aIt != aEnd); ++aIt )
+    for (auto const& siteInfo : mrFormData.maSiteInfos)
     {
-        if( (aIt->mbInStream) && (aIt->mnLength > 0) )
+        if (mxStrm->isEof())
+            break;
+        if( (siteInfo.mbInStream) && (siteInfo.mnLength > 0) )
         {
             mxOut->emptyLine();
-            writeDecItem( "control-id", aIt->mnId );
-            writeInfoItem( "prog-id", aIt->maProgId );
+            writeDecItem( "control-id", siteInfo.mnId );
+            writeInfoItem( "prog-id", siteInfo.maProgId );
             IndentGuard aIndGuard( mxOut );
-            BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, aIt->mnLength ) );
-            FormControlStreamObject( *this, xRelStrm, &aIt->maProgId ).dump();
+            BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, siteInfo.mnLength ) );
+            FormControlStreamObject( *this, xRelStrm, &siteInfo.maProgId ).dump();
         }
     }
     dumpRemainingStream();
@@ -1833,8 +1839,8 @@ bool VbaContainerStorageObject::isFormStorage( const OUString& rStrgPath ) const
             aId = aId.copy( 1 );
         sal_Int32 nId = aId.toInt32();
         if( (nId > 0) && (OUString::number( nId ) == aId) )
-            for( VbaFormSiteInfoVector::const_iterator aIt = maFormData.maSiteInfos.begin(), aEnd = maFormData.maSiteInfos.end(); aIt != aEnd; ++aIt )
-                if( aIt->mnId == nId )
+            for (auto const& siteInfo : maFormData.maSiteInfos)
+                if( siteInfo.mnId == nId )
                     return true;
     }
     return false;
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index b27aa98edde2..941762e3147e 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1601,10 +1601,9 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart
 {
     FSHelperPtr pFS = GetFS();
     std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
-    for (auto itr = aSplitDataSeries.begin(), itrEnd = aSplitDataSeries.end();
-            itr != itrEnd; ++itr)
+    for (auto & splitDataSeries : aSplitDataSeries)
     {
-        if (itr->getLength() == 0)
+        if (splitDataSeries.getLength() == 0)
             continue;
 
         sal_Int32 nTypeId = XML_lineChart;
@@ -1618,7 +1617,7 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart
         exportVaryColors(xChartType);
         // TODO: show marker symbol in series?
         bool bPrimaryAxes = true;
-        exportSeries(xChartType, *itr, bPrimaryAxes);
+        exportSeries(xChartType, splitDataSeries, bPrimaryAxes);
 
         // show marker?
         sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
@@ -1734,14 +1733,13 @@ void ChartExport::exportScatterChart( const Reference< chart2::XChartType >& xCh
     FSHelperPtr pFS = GetFS();
     std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
     bool bExported = false;
-    for (auto itr = aSplitDataSeries.begin(), itrEnd = aSplitDataSeries.end();
-            itr != itrEnd; ++itr)
+    for (auto & splitDataSeries : aSplitDataSeries)
     {
-        if (itr->getLength() == 0)
+        if (splitDataSeries.getLength() == 0)
             continue;
 
         bExported = true;
-        exportScatterChartSeries(xChartType, &(*itr));
+        exportScatterChartSeries(xChartType, &splitDataSeries);
     }
     if (!bExported)
         exportScatterChartSeries(xChartType, nullptr);
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index bf10bf23febc..9ca322fbc477 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2500,10 +2500,10 @@ void DrawingML::WritePresetShape( const char* pShape , std::vector< std::pair<sa
     {
 
         mpFS->startElementNS( XML_a, XML_avLst, FSEND );
-        for(auto iter = rAvList.begin() ; iter != rAvList.end() ; ++iter)
+        for (auto const& elem : rAvList)
         {
-            OString sName = OString("adj") + ( ( iter->first > 0 ) ? OString::number(iter->first) : OString() );
-            OString sFmla = OString("val ") + OString::number( iter->second );
+            OString sName = OString("adj") + ( ( elem.first > 0 ) ? OString::number(elem.first) : OString() );
+            OString sFmla = OString("val ") + OString::number( elem.second );
 
             mpFS->singleElementNS( XML_a, XML_gd,
                     XML_name, sName.getStr(),
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 2877b9b87b21..2ec6992381a6 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -402,9 +402,9 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
     bool bAlreadyWritten[ 0xFFF ];
     memset( bAlreadyWritten, 0, sizeof( bAlreadyWritten ) );
     const EscherProperties &rOpts = rProps.GetOpts();
-    for ( EscherProperties::const_iterator it = rOpts.begin(); it != rOpts.end(); ++it )
+    for (auto const& opt : rOpts)
     {
-        sal_uInt16 nId = ( it->nPropId & 0x0FFF );
+        sal_uInt16 nId = ( opt.nPropId & 0x0FFF );
 
         if ( bAlreadyWritten[ nId ] )
             continue;
@@ -414,7 +414,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
             case ESCHER_Prop_WrapText: // 133
                 {
                     const char *pWrapType = nullptr;
-                    switch ( it->nPropValue )
+                    switch ( opt.nPropValue )
                     {
                         case ESCHER_WrapSquare:
                         case ESCHER_WrapByPoints:  pWrapType = "square"; break; // these two are equivalent according to the docu
@@ -438,12 +438,12 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
 
                     if ( nId == ESCHER_Prop_geoLeft )
                     {
-                        nLeft = it->nPropValue;
+                        nLeft = opt.nPropValue;
                         rProps.GetOpt( ESCHER_Prop_geoTop, nTop );
                     }
                     else
                     {
-                        nTop = it->nPropValue;
+                        nTop = opt.nPropValue;
                         rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft );
                     }
                     if(nTop!=0 && nLeft!=0)
@@ -466,12 +466,12 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
 
                     if ( nId == ESCHER_Prop_geoRight )
                     {
-                        nRight = it->nPropValue;
+                        nRight = opt.nPropValue;
                         rProps.GetOpt( ESCHER_Prop_geoBottom, nBottom );
                     }
                     else
                     {
-                        nBottom = it->nPropValue;
+                        nBottom = opt.nPropValue;
                         rProps.GetOpt( ESCHER_Prop_geoRight, nRight );
                     }
 
@@ -859,7 +859,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
                 break;
 
             case ESCHER_Prop_fHidden:
-                if ( !it->nPropValue )
+                if ( !opt.nPropValue )
                     m_ShapeStyle.append( ";visibility:hidden" );
                 break;
             case ESCHER_Prop_shadowColor:
@@ -895,9 +895,9 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
                     if (rProps.GetOpt(ESCHER_Prop_gtextUNICODE, aUnicode))
                     {
                         SvMemoryStream aStream;
-                        aStream.WriteBytes(it->pBuf, it->nPropSize);
+                        aStream.WriteBytes(opt.pBuf, opt.nPropSize);
                         aStream.Seek(0);
-                        OUString aTextPathString = SvxMSDffManager::MSDFFReadZString(aStream, it->nPropSize, true);
+                        OUString aTextPathString = SvxMSDffManager::MSDFFReadZString(aStream, opt.nPropSize, true);
                         aStream.Seek(0);
 
                         m_pSerializer->singleElementNS( XML_v, XML_path,
@@ -939,23 +939,23 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
             case ESCHER_Prop_Rotation:
                 {
                     // The higher half of the variable contains the angle.
-                    m_ShapeStyle.append(";rotation:").append(double(it->nPropValue >> 16));
+                    m_ShapeStyle.append(";rotation:").append(double(opt.nPropValue >> 16));
                     bAlreadyWritten[ESCHER_Prop_Rotation] = true;
                 }
                 break;
             case ESCHER_Prop_fNoLineDrawDash:
                 {
                     // See DffPropertyReader::ApplyLineAttributes().
-                    impl_AddBool( m_pShapeAttrList, XML_stroked, (it->nPropValue & 8) != 0 );
+                    impl_AddBool( m_pShapeAttrList, XML_stroked, (opt.nPropValue & 8) != 0 );
                     bAlreadyWritten[ESCHER_Prop_fNoLineDrawDash] = true;
                 }
                 break;
             case ESCHER_Prop_wzName:
                 {
                     SvMemoryStream aStream;
-                    aStream.WriteBytes(it->pBuf, it->nPropSize);
+                    aStream.WriteBytes(opt.pBuf, opt.nPropSize);
                     aStream.Seek(0);
-                    OUString idStr = SvxMSDffManager::MSDFFReadZString(aStream, it->nPropSize, true);
+                    OUString idStr = SvxMSDffManager::MSDFFReadZString(aStream, opt.nPropSize, true);
                     aStream.Seek(0);
                     if (!IsWaterMarkShape(m_pSdrObject->GetName()) && !m_bSkipwzName)
                          m_pShapeAttrList->add(XML_ID, OUStringToOString(idStr, RTL_TEXTENCODING_UTF8).getStr());
@@ -966,12 +966,12 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
             default:
 #if OSL_DEBUG_LEVEL > 0
                 fprintf( stderr, "TODO VMLExport::Commit(), unimplemented id: %d, value: %" SAL_PRIuUINT32 ", data: [%" SAL_PRIuUINT32 ", %p]\n",
-                        nId, it->nPropValue, it->nPropSize, it->pBuf );
-                if ( it->nPropSize )
+                        nId, opt.nPropValue, opt.nPropSize, opt.pBuf );
+                if ( opt.nPropSize )
                 {
-                    const sal_uInt8 *pIt = it->pBuf;
+                    const sal_uInt8 *pIt = opt.pBuf;
                     fprintf( stderr, "    ( " );
-                    for ( int nCount = it->nPropSize; nCount; --nCount )
+                    for ( int nCount = opt.nPropSize; nCount; --nCount )
                     {
                         fprintf( stderr, "%02x ", *pIt );
                         ++pIt;
diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx
index bc060027e7cf..84133f6cc6a6 100644
--- a/oox/source/helper/binaryinputstream.cxx
+++ b/oox/source/helper/binaryinputstream.cxx
@@ -90,8 +90,8 @@ OUString BinaryInputStream::readUnicodeArray( sal_Int32 nChars )
 
     OUStringBuffer aStringBuffer;
     aStringBuffer.ensureCapacity( nCharsRead );
-    for( ::std::vector< sal_uInt16 >::iterator aIt = aBuffer.begin(), aEnd = aBuffer.end(); aIt != aEnd; ++aIt )
-        aStringBuffer.append( static_cast< sal_Unicode >( *aIt ) );
+    for (auto const& elem : aBuffer)
+        aStringBuffer.append( static_cast< sal_Unicode >(elem) );
     return aStringBuffer.makeStringAndClear();
 }
 
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 15c4c31737e6..56b598a031df 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -153,12 +153,13 @@ Sequence< Property > SAL_CALL GenericPropertySet::getProperties()
 {
     Sequence< Property > aSeq( static_cast< sal_Int32 >( maPropMap.size() ) );
     Property* pProperty = aSeq.getArray();
-    for( PropertyNameMap::iterator aIt = maPropMap.begin(), aEnd = maPropMap.end(); aIt != aEnd; ++aIt, ++pProperty )
+    for (auto const& prop : maPropMap)
     {
-        pProperty->Name = aIt->first;
+        pProperty->Name = prop.first;
         pProperty->Handle = 0;
-        pProperty->Type = aIt->second.getValueType();
+        pProperty->Type = prop.second.getValueType();
         pProperty->Attributes = 0;
+        ++pProperty;
     }
     return aSeq;
 }
@@ -230,8 +231,8 @@ const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId )
 
 void PropertyMap::assignAll( const PropertyMap& rPropMap )
 {
-    for( PropertyMapType::const_iterator it=rPropMap.maProperties.begin(); it != rPropMap.maProperties.end(); ++it )
-        maProperties[it->first] = it->second;
+    for (auto const& prop : rPropMap.maProperties)
+        maProperties[prop.first] = prop.second;
 }
 
 Sequence< PropertyValue > PropertyMap::makePropertyValueSequence() const
@@ -240,12 +241,13 @@ Sequence< PropertyValue > PropertyMap::makePropertyValueSequence() const
     if( !maProperties.empty() )
     {
         PropertyValue* pValues = aSeq.getArray();
-        for( PropertyMapType::const_iterator aIt = maProperties.begin(), aEnd = maProperties.end(); aIt != aEnd; ++aIt, ++pValues )
+        for (auto const& prop : maProperties)
         {
-            OSL_ENSURE( (0 <= aIt->first) && (aIt->first < PROP_COUNT), "PropertyMap::makePropertyValueSequence - invalid property identifier" );
-            pValues->Name = (*mpPropNames)[ aIt->first ];
-            pValues->Value = aIt->second;
+            OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT), "PropertyMap::makePropertyValueSequence - invalid property identifier" );
+            pValues->Name = (*mpPropNames)[ prop.first ];
+            pValues->Value = prop.second;
             pValues->State = PropertyState_DIRECT_VALUE;
+            ++pValues;
         }
     }
     return aSeq;
@@ -259,21 +261,22 @@ void PropertyMap::fillSequences( Sequence< OUString >& rNames, Sequence< Any >&
     {
         OUString* pNames = rNames.getArray();
         Any* pValues = rValues.getArray();
-        for( PropertyMapType::const_iterator aIt = maProperties.begin(), aEnd = maProperties.end(); aIt != aEnd; ++aIt, ++pNames, ++pValues )
+        for (auto const& prop : maProperties)
         {
-            OSL_ENSURE( (0 <= aIt->first) && (aIt->first < PROP_COUNT), "PropertyMap::fillSequences - invalid property identifier" );
-            *pNames = (*mpPropNames)[ aIt->first ];
-            *pValues = aIt->second;
+            OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT), "PropertyMap::fillSequences - invalid property identifier" );
+            *pNames = (*mpPropNames)[ prop.first ];
+            *pValues = prop.second;
+            ++pNames;
+            ++pValues;
         }
     }
 }
 
 void PropertyMap::fillPropertyNameMap(PropertyNameMap& rMap) const
 {
-    for(PropertyMapType::const_iterator itr = maProperties.begin(),
-            itrEnd = maProperties.end(); itr != itrEnd; ++itr)
+    for (auto const& prop : maProperties)
     {
-        rMap.insert(std::pair<OUString, Any>((*mpPropNames)[itr->first], itr->second));
+        rMap.insert(std::pair<OUString, Any>((*mpPropNames)[prop.first], prop.second));
     }
 }
 
diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx
index dafa334cbba0..2fb8a708fd70 100644
--- a/oox/source/helper/storagebase.cxx
+++ b/oox/source/helper/storagebase.cxx
@@ -224,8 +224,8 @@ void StorageBase::copyStorageToStorage( StorageBase& rDestStrg )
     {
         ::std::vector< OUString > aElements;
         getElementNames( aElements );
-        for( ::std::vector< OUString >::iterator aIt = aElements.begin(), aEnd = aElements.end(); aIt != aEnd; ++aIt )
-            copyToStorage( rDestStrg, *aIt );
+        for (auto const& elem : aElements)
+            copyToStorage(rDestStrg, elem);
     }
 }
 
diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx
index 14ed7f382d9d..e478677f9aeb 100644
--- a/oox/source/ole/axbinaryreader.cxx
+++ b/oox/source/ole/axbinaryreader.cxx
@@ -249,9 +249,11 @@ bool AxBinaryPropertyReader::finalizeImport()
     maInStrm.align( 4 );
     if( ensureValid( mnPropFlags == 0 ) && !maLargeProps.empty() )
     {
-        for( ComplexPropVector::iterator aIt = maLargeProps.begin(), aEnd = maLargeProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
+        for (auto const& largeProp : maLargeProps)
         {
-            ensureValid( (*aIt)->readProperty( maInStrm ) );
+            if (!ensureValid())
+                break;
+            ensureValid( largeProp->readProperty( maInStrm ) );
             maInStrm.align( 4 );
         }
     }
@@ -259,8 +261,14 @@ bool AxBinaryPropertyReader::finalizeImport()
 
     // read stream properties (no stream alignment between properties!)
     if( ensureValid() && !maStreamProps.empty() )
-        for( ComplexPropVector::iterator aIt = maStreamProps.begin(), aEnd = maStreamProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
-            ensureValid( (*aIt)->readProperty( maInStrm ) );
+    {
+        for (auto const& streamProp : maStreamProps)
+        {
+            if (!ensureValid())
+                break;
+            ensureValid( streamProp->readProperty( maInStrm ) );
+        }
+    }
 
     return mbValid;
 }
diff --git a/oox/source/ole/axbinarywriter.cxx b/oox/source/ole/axbinarywriter.cxx
index a0e4b83f23ce..b532527923ab 100644
--- a/oox/source/ole/axbinarywriter.cxx
+++ b/oox/source/ole/axbinarywriter.cxx
@@ -157,9 +157,11 @@ void AxBinaryPropertyWriter::finalizeExport()
     maOutStrm.align( 4 );
     if( !maLargeProps.empty() )
     {
-        for( ComplexPropVector::iterator aIt = maLargeProps.begin(), aEnd = maLargeProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
+        for (auto const& largeProp : maLargeProps)
         {
-            (*aIt)->writeProperty( maOutStrm );
+            if (!ensureValid())
+                break;
+            largeProp->writeProperty( maOutStrm );
             maOutStrm.align( 4 );
         }
     }
@@ -168,8 +170,14 @@ void AxBinaryPropertyWriter::finalizeExport()
 
     // write stream properties (no stream alignment between properties!)
     if( !maStreamProps.empty() )
-        for( ComplexPropVector::iterator aIt = maStreamProps.begin(), aEnd = maStreamProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
-           (*aIt)->writeProperty( maOutStrm );
+    {
+        for (auto const& streamProp : maStreamProps)
+        {
+            if (!ensureValid())
+                break;
+           streamProp->writeProperty( maOutStrm );
+        }
+    }
 
     sal_Int64 nPos = maOutStrm.tell();
     maOutStrm.seek( mnPropFlagsStart - sizeof( mnBlockSize ) );
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index ea6f461bbdcf..c8be2ca7c7bc 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -2589,15 +2589,15 @@ HtmlSelectModel::importBinaryModel( BinaryInputStream& rInStrm )
     {
         msListData.realloc( listValues.size() );
         sal_Int32 index = 0;
-        for( std::vector< OUString >::iterator it = listValues.begin(); it != listValues.end(); ++it, ++index )
-             msListData[ index ] = *it;
+        for (auto const& listValue : listValues)
+             msListData[ index++ ] = listValue;
     }
     if ( !selectedIndices.empty() )
     {
         msIndices.realloc( selectedIndices.size() );
         sal_Int32 index = 0;
-        for( std::vector< sal_Int16 >::iterator it = selectedIndices.begin(); it != selectedIndices.end(); ++it, ++index )
-             msIndices[ index ] = *it;
+        for (auto const& selectedIndice : selectedIndices)
+             msIndices[ index++ ] = selectedIndice;
     }
     return true;
 }
diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx
index 51e1b04223c8..36b9278c079d 100644
--- a/oox/source/ole/vbacontrol.cxx
+++ b/oox/source/ole/vbacontrol.cxx
@@ -424,13 +424,11 @@ void VbaFormControl::importStorage( StorageBase& rStrg, const AxClassTable& rCla
                 }
                 typedef std::unordered_map< sal_uInt32, std::shared_ptr< VbaFormControl > > IdToPageMap;
                 IdToPageMap idToPage;
-                VbaFormControlVector::iterator it = maControls.begin();
-                VbaFormControlVector::iterator it_end = maControls.end();
                 AxArrayString sCaptions;
 
-                for ( ; it != it_end; ++it )
+                for (auto const& control : maControls)
                 {
-                    auto& elem = (*it)->mxCtrlModel;
+                    auto& elem = control->mxCtrlModel;
                     if (!elem)
                     {
                         SAL_WARN("oox", "empty control model");
@@ -438,9 +436,9 @@ void VbaFormControl::importStorage( StorageBase& rStrg, const AxClassTable& rCla
                     }
                     if (elem->getControlType() == API_CONTROL_PAGE)
                     {
-                        VbaSiteModelRef xPageSiteRef = (*it)->mxSiteModel;
+                        VbaSiteModelRef xPageSiteRef = control->mxSiteModel;
                         if ( xPageSiteRef.get() )
-                            idToPage[ xPageSiteRef->getId() ] = (*it);
+                            idToPage[ xPageSiteRef->getId() ] = control;
                     }
                     else
                     {
@@ -599,9 +597,9 @@ void VbaFormControl::finalizeEmbeddedControls()
     VbaControlNamesSet aControlNames;
     VbaControlNameInserter aInserter( aControlNames );
     maControls.forEach( aInserter );
-    for( VbaFormControlVector::iterator aIt = maControls.begin(), aEnd = maControls.end(); aIt != aEnd; ++aIt )
-        if( (*aIt)->mxCtrlModel.get() && ((*aIt)->mxCtrlModel->getControlType() == API_CONTROL_GROUPBOX) )
-            (*aIt)->maControls.forEach( aInserter );
+    for (auto const& control : maControls)
+        if( control->mxCtrlModel.get() && (control->mxCtrlModel->getControlType() == API_CONTROL_GROUPBOX) )
+            control->maControls.forEach( aInserter );
 
     /*  Reprocess the sorted list and collect all option button controls that
         are part of the same option group (determined by group name). All
@@ -618,10 +616,9 @@ void VbaFormControl::finalizeEmbeddedControls()
 
     typedef VbaFormControlVectorMap::mapped_type VbaFormControlVectorRef;
     bool bLastWasOptionButton = false;
-    for( VbaFormControlVector::iterator aIt = maControls.begin(), aEnd = maControls.end(); aIt != aEnd; ++aIt )
+    for (auto const& control : maControls)
     {
-        VbaFormControlRef xControl = *aIt;
-        const ControlModelBase* pCtrlModel = xControl->mxCtrlModel.get();
+        const ControlModelBase* pCtrlModel = control->mxCtrlModel.get();
 
         if( const AxOptionButtonModel* pOptButtonModel = dynamic_cast< const AxOptionButtonModel* >( pCtrlModel ) )
         {
@@ -647,7 +644,7 @@ void VbaFormControl::finalizeEmbeddedControls()
             /*  Append the option button to the control group (which is now
                 referred by the vector aControlGroups and by the map
                 aOptionGroups). */
-            rxOptionGroup->push_back( xControl );
+            rxOptionGroup->push_back(control);
             bLastWasOptionButton = true;
         }
         else
@@ -660,7 +657,7 @@ void VbaFormControl::finalizeEmbeddedControls()
             }
             // append the control to the last control group
             VbaFormControlVector& rLastGroup = *aControlGroups.back();
-            rLastGroup.push_back( xControl );
+            rLastGroup.push_back(control);
             bLastWasOptionButton = false;
 
             // if control is a group box, move all its children to this control
@@ -668,11 +665,11 @@ void VbaFormControl::finalizeEmbeddedControls()
             {
                 /*  Move all embedded controls of the group box relative to the
                     position of the group box. */
-                xControl->moveEmbeddedToAbsoluteParent();
+                control->moveEmbeddedToAbsoluteParent();
                 /*  Insert all children of the group box into the last control
                     group (following the group box). */
-                rLastGroup.insert( rLastGroup.end(), xControl->maControls.begin(), xControl->maControls.end() );
-                xControl->maControls.clear();
+                rLastGroup.insert( rLastGroup.end(), control->maControls.begin(), control->maControls.end() );
+                control->maControls.clear();
                 // check if last control of the group box is an option button
                 bLastWasOptionButton = dynamic_cast< const AxOptionButtonModel* >( rLastGroup.back()->mxCtrlModel.get() ) != nullptr;
             }
@@ -681,8 +678,8 @@ void VbaFormControl::finalizeEmbeddedControls()
 
     // flatten the vector of vectors of form controls to a single vector
     maControls.clear();
-    for( VbaFormControlVectorVector::iterator aIt = aControlGroups.begin(), aEnd = aControlGroups.end(); aIt != aEnd; ++aIt )
-        maControls.insert( maControls.end(), (*aIt)->begin(), (*aIt)->end() );
+    for (auto const& controlGroup : aControlGroups)
+        maControls.insert( maControls.end(), controlGroup->begin(), controlGroup->end() );
 }
 
 void VbaFormControl::moveRelative( const AxPairData& rDistance )
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index 6a00b0cb3f57..5a779944e0e6 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -431,12 +431,12 @@ void VbaProject::importModulesAndForms( StorageBase& rVbaPrjStrg, const GraphicH
 
     // create empty dummy modules
     VbaModuleMap aDummyModules;
-    for( DummyModuleMap::iterator aIt = maDummyModules.begin(), aEnd = maDummyModules.end(); aIt != aEnd; ++aIt )
+    for (auto const& dummyModule : maDummyModules)
     {
-        OSL_ENSURE( !maModules.has( aIt->first ) && !aDummyModules.has( aIt->first ), "VbaProject::importVba - multiple modules with the same name" );
-        VbaModuleMap::mapped_type& rxModule = aDummyModules[ aIt->first ];
-        rxModule.reset( new VbaModule( mxContext, mxDocModel, aIt->first, eTextEnc, bExecutable ) );
-        rxModule->setType( aIt->second );
+        OSL_ENSURE( !maModules.has( dummyModule.first ) && !aDummyModules.has( dummyModule.first ), "VbaProject::importVba - multiple modules with the same name" );
+        VbaModuleMap::mapped_type& rxModule = aDummyModules[ dummyModule.first ];
+        rxModule.reset( new VbaModule( mxContext, mxDocModel, dummyModule.first, eTextEnc, bExecutable ) );
+        rxModule->setType( dummyModule.second );
     }
 
     /*  Now it is time to load the source code. All modules will be inserted
@@ -483,16 +483,16 @@ void VbaProject::importModulesAndForms( StorageBase& rVbaPrjStrg, const GraphicH
         storages that misses to mention a module for an existing form. */
     ::std::vector< OUString > aElements;
     rVbaPrjStrg.getElementNames( aElements );
-    for( ::std::vector< OUString >::iterator aIt = aElements.begin(), aEnd = aElements.end(); aIt != aEnd; ++aIt )
+    for (auto const& elem : aElements)
     {
         // try to open the element as storage
-        if( *aIt != "VBA" )
+        if( elem != "VBA" )
         {
-            StorageRef xSubStrg = rVbaPrjStrg.openSubStorage( *aIt, false );
+            StorageRef xSubStrg = rVbaPrjStrg.openSubStorage( elem, false );
             if( xSubStrg.get() ) try
             {
                 // resolve module name from storage name (which equals the module stream name)
-                VbaModule* pModule = maModulesByStrm.get( *aIt ).get();
+                VbaModule* pModule = maModulesByStrm.get( elem ).get();
                 OSL_ENSURE( pModule && (pModule->getType() == ModuleType::FORM),
                     "VbaProject::importVba - form substorage without form module" );
                 OUString aModuleName;
diff --git a/oox/source/ppt/animationspersist.cxx b/oox/source/ppt/animationspersist.cxx
index 2c1aaa2c88c7..6841c7ff2558 100644
--- a/oox/source/ppt/animationspersist.cxx
+++ b/oox/source/ppt/animationspersist.cxx
@@ -186,10 +186,9 @@ namespace oox { namespace ppt {
     Any AnimationCondition::convertList(const SlidePersistPtr & pSlide, const AnimationConditionList & l)
     {
         Any aAny;
-        for( AnimationConditionList::const_iterator iter = l.begin();
-             iter != l.end(); ++iter)
+        for (auto const& elem : l)
         {
-            aAny = addToSequence( aAny, iter->convert(pSlide) );
+            aAny = addToSequence( aAny, elem.convert(pSlide) );
         }
         return aAny;
     }
diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx
index 8a731c550713..34206cffa37e 100644
--- a/oox/source/ppt/comments.cxx
+++ b/oox/source/ppt/comments.cxx
@@ -15,16 +15,16 @@ namespace oox { namespace ppt {
 
 void CommentAuthorList::setValues(const CommentAuthorList& list)
 {
-    std::vector<CommentAuthor>::const_iterator it;
-    for(it = list.cmAuthorLst.begin(); it != list.cmAuthorLst.end(); ++it)
+    for (auto const& author : list.cmAuthorLst)
     {
         CommentAuthor temp;
+        // TODO JNA : why not doing push_back at the end instead of using back()?
         cmAuthorLst.push_back(temp);
-        cmAuthorLst.back().clrIdx = it->clrIdx;
-        cmAuthorLst.back().id = it->id;
-        cmAuthorLst.back().initials = it->initials;
-        cmAuthorLst.back().lastIdx = it->lastIdx;
-        cmAuthorLst.back().name = it->name;
+        cmAuthorLst.back().clrIdx = author.clrIdx;
+        cmAuthorLst.back().id = author.id;
+        cmAuthorLst.back().initials = author.initials;
+        cmAuthorLst.back().lastIdx = author.lastIdx;
+        cmAuthorLst.back().name = author.name;
     }
 }
 
@@ -65,11 +65,10 @@ void Comment::setDateTime (const OUString& _datetime)
 OUString Comment::getAuthor ( const CommentAuthorList& list )
 {
     const sal_Int32 nId = authorId.toInt32();
-    std::vector<CommentAuthor>::const_iterator it;
-    for(it = list.cmAuthorLst.begin(); it != list.cmAuthorLst.end(); ++it)
+    for (auto const& author : list.cmAuthorLst)
     {
-        if(it->id.toInt32() == nId)
-            return it->name;
+        if(author.id.toInt32() == nId)
+            return author.name;
     }
     return OUString("Anonymous");
 }
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 235dd3fc6c10..1d639f3316b3 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -133,10 +133,9 @@ void PPTShapeGroupContext::importExtDrawings( )
 {
     if( pGraphicShape )
     {
-        for( ::std::vector<OUString>::const_iterator aIt = pGraphicShape->getExtDrawings().begin(), aEnd = pGraphicShape->getExtDrawings().end();
-                    aIt != aEnd; ++aIt )
+        for (auto const& extDrawing : pGraphicShape->getExtDrawings())
             {
-                getFilter().importFragment( new ExtDrawingFragmentHandler( getFilter(), getFragmentPathFromRelId( *aIt ),
+                getFilter().importFragment( new ExtDrawingFragmentHandler( getFilter(), getFragmentPathFromRelId(extDrawing),
                                                                            mpSlidePersistPtr,
                                                                            meShapeLocation,
                                                                            mpGroupShapePtr,
@@ -153,9 +152,9 @@ void PPTShapeGroupContext::applyFontRefColor(const oox::drawingml::ShapePtr& pSh
 {
     pShape->getShapeStyleRefs()[XML_fontRef].maPhClr = rFontRefColor;
     std::vector< oox::drawingml::ShapePtr >& vChildren = pShape->getChildren();
-    for( std::vector< oox::drawingml::ShapePtr >::iterator aIter = vChildren.begin(); aIter != vChildren.end(); ++aIter )
+    for (auto const& child : vChildren)
     {
-        applyFontRefColor( *aIter ,rFontRefColor);
+        applyFontRefColor(child, rFontRefColor);
     }
 }
 
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index a874c73099b5..9b6a35c804ee 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -85,13 +85,13 @@ PresentationFragmentHandler::PresentationFragmentHandler(XmlFilterBase& rFilter,
     , mpTextListStyle( new TextListStyle )
     , mbCommentAuthorsRead(false)
 {
+    // TODO JNA Typo
     TextParagraphPropertiesVector& rParagraphDefaulsVector( mpTextListStyle->getListStyle() );
-    TextParagraphPropertiesVector::iterator aParagraphDefaultIter( rParagraphDefaulsVector.begin() );
-    while( aParagraphDefaultIter != rParagraphDefaulsVector.end() )
+    for (auto const& elem : rParagraphDefaulsVector)
     {
         // ppt is having zero bottom margin per default, whereas OOo is 0,5cm,
         // so this attribute needs to be set always
-        (*aParagraphDefaultIter++)->getParaBottomMargin() = TextSpacing( 0 );
+        elem->getParaBottomMargin() = TextSpacing( 0 );
     }
 }
 
@@ -105,14 +105,13 @@ void ResolveTextFields( XmlFilterBase const & rFilter )
     if ( !rTextFields.empty() )
     {
         Reference< frame::XModel > xModel( rFilter.getModel() );
-        oox::core::TextFieldStack::const_iterator aIter( rTextFields.begin() );
-        while( aIter != rTextFields.end() )
+        for (auto const& textField : rTextFields)
         {
             const OUString sURL = "URL";
             Reference< drawing::XDrawPagesSupplier > xDPS( xModel, uno::UNO_QUERY_THROW );
             Reference< drawing::XDrawPages > xDrawPages( xDPS->getDrawPages(), uno::UNO_QUERY_THROW );
 
-            const oox::core::TextField& rTextField( *aIter++ );
+            const oox::core::TextField& rTextField( textField );
             Reference< XPropertySet > xPropSet( rTextField.xTextField, UNO_QUERY );
             Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() );
             if ( xPropSetInfo->hasPropertyByName( sURL ) )
@@ -257,15 +256,13 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
                 {
                     // check if the corresponding masterpage+layout has already been imported
                     std::vector< SlidePersistPtr >& rMasterPages( rFilter.getMasterPages() );
-                    std::vector< SlidePersistPtr >::iterator aIter( rMasterPages.begin() );
-                    while( aIter != rMasterPages.end() )
+                    for (auto const& masterPage : rMasterPages)
                     {
-                        if ( ( (*aIter)->getPath() == aMasterFragmentPath ) && ( (*aIter)->getLayoutPath() == aLayoutFragmentPath ) )
+                        if ( ( masterPage->getPath() == aMasterFragmentPath ) && ( masterPage->getLayoutPath() == aLayoutFragmentPath ) )
                         {
-                            pMasterPersistPtr = *aIter;
+                            pMasterPersistPtr = masterPage;
                             break;
                         }
-                        ++aIter;
                     }
 
                     if ( !pMasterPersistPtr.get() )
@@ -471,9 +468,7 @@ void PresentationFragmentHandler::finalizeImport()
     }
 
     StringRangeEnumerator aRangeEnumerator( aPageRange, 0, nPageCount - 1 );
-    StringRangeEnumerator::Iterator aIter = aRangeEnumerator.begin();
-    StringRangeEnumerator::Iterator aEnd  = aRangeEnumerator.end();
-    if (aIter!=aEnd)
+    if (aRangeEnumerator.size())
     {
         // todo: localized progress bar text
         const Reference< task::XStatusIndicator >& rxStatusIndicator( getFilter().getStatusIndicator() );
@@ -483,14 +478,13 @@ void PresentationFragmentHandler::finalizeImport()
         try
         {
             int nPagesImported = 0;
-            while (aIter!=aEnd)
+            for (auto const& elem : aRangeEnumerator)
             {
                 if ( rxStatusIndicator.is() )
                     rxStatusIndicator->setValue((nPagesImported * 10000) / aRangeEnumerator.size());
 
-                importSlide(*aIter, !nPagesImported, bImportNotesPages);
+                importSlide(elem, !nPagesImported, bImportNotesPages);
                 nPagesImported++;
-                ++aIter;
             }
             ResolveTextFields( rFilter );
         }
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 7e5530322dc8..b04cbdb3cd90 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -95,18 +95,18 @@ SlideFragmentHandler::~SlideFragmentHandler()
         OUString aNotesFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "notesMaster" );
 
         std::vector< SlidePersistPtr >& rMasterPages( rFilter.getMasterPages() );
-        std::vector< SlidePersistPtr >::iterator aIter( rMasterPages.begin() );
-        while( aIter != rMasterPages.end() )
+        bool bNotesFragmentPathFound = false;
+        for (auto const& masterPage : rMasterPages)
         {
-            if( (*aIter)->getPath() == aNotesFragmentPath )
+            if( masterPage->getPath() == aNotesFragmentPath )
             {
                 if( !mpSlidePersistPtr->getMasterPersist() )
-                    mpSlidePersistPtr->setMasterPersist( *aIter );
+                    mpSlidePersistPtr->setMasterPersist(masterPage);
+                bNotesFragmentPathFound=true;
                 break;
             }
-            ++aIter;
         }
-        if( aIter == rMasterPages.end() && !mpSlidePersistPtr->getMasterPersist() )
+        if( !bNotesFragmentPathFound && !mpSlidePersistPtr->getMasterPersist() )
         {
             TextListStylePtr pTextListStyle(new TextListStyle);
             SlidePersistPtr pMasterPersistPtr = std::make_shared<SlidePersist>( rFilter, true, true, mpSlidePersistPtr->getPage(),
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index fa330a2bacf7..8d6abaab47e1 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -133,21 +133,17 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase )
     Reference< XShapes > xShapes( getPage(), UNO_QUERY );
 
     std::vector< oox::drawingml::ShapePtr >& rShapes( maShapesPtr->getChildren() );
-    const std::vector< oox::drawingml::ShapePtr >::const_iterator aShapesEnd( rShapes.end() );
-    for (std::vector< oox::drawingml::ShapePtr >::const_iterator aShapesIter( rShapes.begin() );
-         aShapesIter != aShapesEnd ; ++aShapesIter)
+    for (auto const& shape : rShapes)
     {
-        std::vector< oox::drawingml::ShapePtr >& rChildren( (*aShapesIter)->getChildren() );
-        const std::vector< oox::drawingml::ShapePtr >::const_iterator aChildEnd( rChildren.end() );
-        for (std::vector< oox::drawingml::ShapePtr >::const_iterator aChildIter( rChildren.begin() );
-             aChildIter != aChildEnd ; ++aChildIter)
+        std::vector< oox::drawingml::ShapePtr >& rChildren( shape->getChildren() );
+        for (auto const& child : rChildren)
         {
-            PPTShape* pPPTShape = dynamic_cast< PPTShape* >( (*aChildIter).get() );
+            PPTShape* pPPTShape = dynamic_cast< PPTShape* >( child.get() );
             basegfx::B2DHomMatrix aTransformation;
             if ( pPPTShape )
                 pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() );
             else
-                (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), &getShapeMap() );
+                child->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), &getShapeMap() );
         }
     }
 
@@ -308,19 +304,15 @@ void SlidePersist::applyTextStyles( const XmlFilterBase& rFilterBase )
 void SlidePersist::hideShapesAsMasterShapes()
 {
     std::vector< oox::drawingml::ShapePtr >& rShapes( maShapesPtr->getChildren() );
-    std::vector< oox::drawingml::ShapePtr >::iterator aShapesIter( rShapes.begin() );
-    while( aShapesIter != rShapes.end() )
+    for (auto const& shape : rShapes)
     {
-        while( aShapesIter != rShapes.end() )
+        std::vector< oox::drawingml::ShapePtr >& rChildren( shape->getChildren() );
+        for (auto const& child : rChildren)
         {
-            std::vector< oox::drawingml::ShapePtr >& rChildren( (*aShapesIter++)->getChildren() );
-            std::vector< oox::drawingml::ShapePtr >::iterator aChildIter( rChildren.begin() );
-            while( aChildIter != rChildren.end() ) {
-                PPTShape* pPPTShape = dynamic_cast< PPTShape* >( (*aChildIter++).get() );
-                if (!pPPTShape)
-                    continue;
-                pPPTShape->setHiddenMasterShape( true );
-            }
+            PPTShape* pPPTShape = dynamic_cast< PPTShape* >( child.get() );
+            if (!pPPTShape)
+                continue;
+            pPPTShape->setHiddenMasterShape( true );
         }
     }
 }
diff --git a/oox/source/ppt/timenode.cxx b/oox/source/ppt/timenode.cxx
index 09d99e3aa102..f695d7918b96 100644
--- a/oox/source/ppt/timenode.cxx
+++ b/oox/source/ppt/timenode.cxx
@@ -269,10 +269,11 @@ namespace oox { namespace ppt {
             {
                 Sequence< NamedValue > aUserDataSeq( static_cast< sal_Int32 >( maUserData.size() ) );
                 NamedValue* pValues = aUserDataSeq.getArray();
-                for( UserDataMap::const_iterator aIt = maUserData.begin(), aEnd = maUserData.end(); aIt != aEnd; ++aIt, ++pValues )
+                for (auto const& elem : maUserData)
                 {
-                    pValues->Name = aIt->first;
-                    pValues->Value = aIt->second;
+                    pValues->Name = elem.first;
+                    pValues->Value = elem.second;
+                    ++pValues;
                 }
                 maNodeProperties[ NP_USERDATA ] <<= aUserDataSeq;
             }
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index b5e2f6dfc6e3..104f92882c27 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -435,12 +435,12 @@ ShapeContextHandler::getShape()
             else
             {
                 // Prerendered diagram output is available, then use that, and throw away the original result.
-                for (std::vector<OUString>::const_iterator aIt = mpShape->getExtDrawings().begin(); aIt != mpShape->getExtDrawings().end(); ++aIt)
+                for (auto const& extDrawing : mpShape->getExtDrawings())
                 {
                     DiagramGraphicDataContext* pDiagramGraphicDataContext = dynamic_cast<DiagramGraphicDataContext*>(mxDiagramShapeContext.get());
                     if (!pDiagramGraphicDataContext)
                         break;
-                    OUString aFragmentPath(pDiagramGraphicDataContext->getFragmentPathFromRelId(*aIt));
+                    OUString aFragmentPath(pDiagramGraphicDataContext->getFragmentPathFromRelId(extDrawing));
                     oox::drawingml::ShapePtr pShapePtr( new Shape( "com.sun.star.drawing.GroupShape" ) );
                     pShapePtr->setDiagramType();
                     mxFilterBase->importFragment(new ShapeDrawingFragmentHandler(*mxFilterBase, aFragmentPath, pShapePtr));
diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx
index 22c62f2b0d30..ebddedaa6a33 100644
--- a/oox/source/token/tokenmap.cxx
+++ b/oox/source/token/tokenmap.cxx
@@ -56,10 +56,11 @@ TokenMap::TokenMap() :
     };
 
     const sal_Char* const* ppcTokenName = sppcTokenNames;
-    for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenName )
+    for (auto & tokenName : maTokenNames)
     {
         OString aUtf8Token( *ppcTokenName );
-        *aIt = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() );
+        tokenName = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() );
+        ++ppcTokenName;
     }
 
     for (unsigned char c = 'a'; c <= 'z'; c++)
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index 3afcbaa8f32c..4545b6924a41 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -138,8 +138,8 @@ void lclProcessAttribs( OStringBuffer& rBuffer, const sal_Char* pcBeg, const sal
 
     // if no error has occurred, build the resulting attribute list
     if( bOk )
-        for( AttributeDataMap::iterator aIt = aAttributes.begin(), aEnd = aAttributes.end(); aIt != aEnd; ++aIt )
-            rBuffer.append( ' ' ).append( aIt->second );
+        for (auto const& attrib : aAttributes)
+            rBuffer.append( ' ' ).append( attrib.second );
     // on error, just append the complete passed string
     else
         lclAppendToBuffer( rBuffer, pcBeg, pcEnd );
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index e30091411cc4..6b496b50e3a0 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -964,8 +964,8 @@ Reference< XShape > PolyLineShape::implConvertAndInsert( const Reference< XShape
     if( !maShapeModel.maPoints.empty() && (aCoordSys.Width > 0) && (aCoordSys.Height > 0) )
     {
         ::std::vector< awt::Point > aAbsPoints;
-        for( ShapeModel::PointVector::const_iterator aIt = maShapeModel.maPoints.begin(), aEnd = maShapeModel.maPoints.end(); aIt != aEnd; ++aIt )
-            aAbsPoints.push_back( lclGetAbsPoint( *aIt, rShapeRect, aCoordSys ) );
+        for (auto const& point : maShapeModel.maPoints)
+            aAbsPoints.push_back( lclGetAbsPoint( point, rShapeRect, aCoordSys ) );
         PointSequenceSequence aPointSeq( 1 );
         aPointSeq[ 0 ] = ContainerHelper::vectorToSequence( aAbsPoints );
         PropertySet aPropSet( xShape );
@@ -1068,10 +1068,10 @@ Reference< XShape > BezierShape::implConvertAndInsert( const Reference< XShapes
             // Parse VML path string and convert to absolute coordinates
             ConversionHelper::decodeVmlPath( aCoordLists, aFlagLists, maShapeModel.maVmlPath );
 
-            for ( SubPathList::iterator aListIt = aCoordLists.begin(); aListIt != aCoordLists.end(); ++aListIt )
-                for ( ::std::vector< awt::Point >::iterator aPointIt = (*aListIt).begin(); aPointIt != (*aListIt).end(); ++aPointIt)
+            for (auto & coordList : aCoordLists)
+                for (auto & point : coordList)
                 {
-                    (*aPointIt) = lclGetAbsPoint( (*aPointIt), rShapeRect, aCoordSys );
+                    point = lclGetAbsPoint( point, rShapeRect, aCoordSys );
                 }
         }
 
diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx
index 46c22990fd80..474c6ac2c86f 100644
--- a/oox/source/vml/vmlshapecontainer.cxx
+++ b/oox/source/vml/vmlshapecontainer.cxx
@@ -36,14 +36,14 @@ namespace {
 template< typename ShapeType >
 void lclMapShapesById( RefMap< OUString, ShapeType >& orMap, const RefVector< ShapeType >& rVector )
 {
-    for( typename RefVector< ShapeType >::const_iterator aIt = rVector.begin(), aEnd = rVector.end(); aIt != aEnd; ++aIt )
+    for (auto const& elem : rVector)
     {
-        const OUString& rShapeId = (*aIt)->getShapeId();
+        const OUString& rShapeId = elem->getShapeId();
         OSL_ENSURE( !rShapeId.isEmpty(), "lclMapShapesById - missing shape identifier" );
         if( !rShapeId.isEmpty() )
         {
             OSL_ENSURE( orMap.find( rShapeId ) == orMap.end(), "lclMapShapesById - shape identifier already used " );
-            orMap[ rShapeId ] = *aIt;
+            orMap[ rShapeId ] = elem;
         }
     }
 }
@@ -83,8 +83,8 @@ const ShapeType* ShapeContainer::getShapeTypeById( const OUString& rShapeId ) co
     if( const ShapeType* pType = maTypesById.get( rShapeId ).get() )
         return pType;
     // search deep in child shapes
-    for( ShapeVector::const_iterator aVIt = maShapes.begin(), aVEnd = maShapes.end(); aVIt != aVEnd; ++aVIt )
-        if( const ShapeType* pType = (*aVIt)->getChildTypeById( rShapeId ) )
+    for (auto const& shape : maShapes)
+        if( const ShapeType* pType = shape->getChildTypeById( rShapeId ) )
             return pType;
    return nullptr;
 }
@@ -95,8 +95,8 @@ const ShapeBase* ShapeContainer::getShapeById( const OUString& rShapeId ) const
     if( const ShapeBase* pShape = maShapesById.get( rShapeId ).get() )
         return pShape;
     // search deep in child shapes
-    for( ShapeVector::const_iterator aVIt = maShapes.begin(), aVEnd = maShapes.end(); aVIt != aVEnd; ++aVIt )
-        if( const ShapeBase* pShape = (*aVIt)->getChildById( rShapeId ) )
+    for (auto const& shape : maShapes)
+        if( const ShapeBase* pShape = shape->getChildById( rShapeId ) )
             return pShape;
    return nullptr;
 }
@@ -125,8 +125,8 @@ void ShapeContainer::popMark()
 
 void ShapeContainer::convertAndInsert( const Reference< XShapes >& rxShapes, const ShapeParentAnchor* pParentAnchor ) const
 {
-    for( ShapeVector::const_iterator aIt = maShapes.begin(), aEnd = maShapes.end(); aIt != aEnd; ++aIt )
-        (*aIt)->convertAndInsert( rxShapes, pParentAnchor );
+    for (auto const& shape : maShapes)
+        shape->convertAndInsert( rxShapes, pParentAnchor );
 }
 
 } // namespace vml
diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx
index af3ddcc36731..ec56cb049fb2 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -68,20 +68,20 @@ const TextFontModel* TextBox::getFirstFont() const
 OUString TextBox::getText() const
 {
     OUStringBuffer aBuffer;
-    for( PortionVector::const_iterator aIt = maPortions.begin(), aEnd = maPortions.end(); aIt != aEnd; ++aIt )
-        aBuffer.append( aIt->maText );
+    for (auto const& portion : maPortions)
+        aBuffer.append( portion.maText );
     return aBuffer.makeStringAndClear();
 }
 
 void TextBox::convert(const uno::Reference<drawing::XShape>& xShape) const
 {
     uno::Reference<text::XTextAppend> xTextAppend(xShape, uno::UNO_QUERY);
-    for (PortionVector::const_iterator aIt = maPortions.begin(), aEnd = maPortions.end(); aIt != aEnd; ++aIt)
+    for (auto const& portion : maPortions)
     {
         beans::PropertyValue aPropertyValue;
         std::vector<beans::PropertyValue> aPropVec;
-        const TextParagraphModel& rParagraph = aIt->maParagraph;
-        const TextFontModel& rFont = aIt->maFont;
+        const TextParagraphModel& rParagraph = portion.maParagraph;
+        const TextFontModel& rFont = portion.maFont;
         if (rFont.moName.has())
         {
             aPropertyValue.Name = "CharFontName";
@@ -135,7 +135,7 @@ void TextBox::convert(const uno::Reference<drawing::XShape>& xShape) const
             aPropertyValue.Value <<= rFont.moColor.get().toUInt32(16);
             aPropVec.push_back(aPropertyValue);
         }
-        xTextAppend->appendTextPortion(aIt->maText, comphelper::containerToSequence(aPropVec));
+        xTextAppend->appendTextPortion(portion.maText, comphelper::containerToSequence(aPropVec));
     }
 
     // Remove the last character of the shape text, if it would be a newline.


More information about the Libreoffice-commits mailing list