summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-03-31 12:17:55 +0200
committerJulien Nabet <serval2412@yahoo.fr>2018-03-31 13:25:28 +0200
commit0d06d1d16775fde3b0b34f3374907e07cbba763d (patch)
treebd74c0df75afe158c8ae9a67dd1c41d2cd2239eb /oox/source/drawingml
parent67c04cecc86f4a2e11da3b1fd982940a526cb6cb (diff)
Use for-range loops in oox (part2)
Change-Id: I7cbeb67a1adcdb9b0003e22b61789a882fc336c9 Reviewed-on: https://gerrit.libreoffice.org/52182 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'oox/source/drawingml')
-rw-r--r--oox/source/drawingml/fillproperties.cxx6
-rw-r--r--oox/source/drawingml/shape.cxx8
-rw-r--r--oox/source/drawingml/textbody.cxx8
-rw-r--r--oox/source/drawingml/textliststyle.cxx8
4 files changed, 16 insertions, 14 deletions
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) );
}
}