summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/shape.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-02-15 00:08:43 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-15 12:21:28 +0100
commit9d7620613d3ea2feb45a7ff57c4d2544bb1c6fe6 (patch)
tree20e56cfbe9a0bc07974fb14861556da74f3ecddc /oox/source/drawingml/shape.cxx
parent177747c44557489760cc00473daecacd99995427 (diff)
Simplify containers iterations in oox, opencl, package
Use range-based loop or replace with STL functions Change-Id: I91405920d91383bc6cf13b9497d262b1f6f0a84d Reviewed-on: https://gerrit.libreoffice.org/67848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r--oox/source/drawingml/shape.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index b935bec0de96..b01aa8ac51ce 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1190,35 +1190,35 @@ Reference< XShape > const & Shape::createAndInsert(
if( aShapeProps.hasProperty( PROP_FillGradient ) )
{
std::vector<beans::PropertyValue> aGradientStops;
- auto aIt = aFillProperties.maGradientProps.maGradientStops.begin();
- for( size_t i = 0; i < aFillProperties.maGradientProps.maGradientStops.size(); ++i )
+ size_t i = 0;
+ for( const auto& [rPos, rColor] : aFillProperties.maGradientProps.maGradientStops )
{ // for each stop in the gradient definition:
// save position
std::vector<beans::PropertyValue> aGradientStop;
- aGradientStop.push_back(comphelper::makePropertyValue("Pos", aIt->first));
+ aGradientStop.push_back(comphelper::makePropertyValue("Pos", rPos));
- OUString sStopColorScheme = aIt->second.getSchemeName();
+ OUString sStopColorScheme = rColor.getSchemeName();
if( sStopColorScheme.isEmpty() )
{
// save RGB color
- aGradientStop.push_back(comphelper::makePropertyValue("RgbClr", aIt->second.getColor(rGraphicHelper, nFillPhClr)));
+ aGradientStop.push_back(comphelper::makePropertyValue("RgbClr", rColor.getColor(rGraphicHelper, nFillPhClr)));
// in the case of a RGB color, transformations are already applied to
// the color with the exception of alpha transformations. We only need
// to keep the transparency value to calculate the alpha value later.
- if( aIt->second.hasTransparency() )
- aGradientStop.push_back(comphelper::makePropertyValue("Transparency", aIt->second.getTransparency()));
+ if( rColor.hasTransparency() )
+ aGradientStop.push_back(comphelper::makePropertyValue("Transparency", rColor.getTransparency()));
}
else
{
// save color with scheme name
aGradientStop.push_back(comphelper::makePropertyValue("SchemeClr", sStopColorScheme));
// save all color transformations
- aGradientStop.push_back(comphelper::makePropertyValue("Transformations", aIt->second.getTransformations()));
+ aGradientStop.push_back(comphelper::makePropertyValue("Transformations", rColor.getTransformations()));
}
aGradientStops.push_back(comphelper::makePropertyValue(OUString::number(i), comphelper::containerToSequence(aGradientStop)));
- ++aIt;
+ ++i;
}
// If getFillProperties.moFillType is unused that means gradient is defined by a theme
// which is already saved into StyleFillRef property, so no need to save the explicit values too