diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-02-26 19:53:16 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-02-27 07:21:01 +0100 |
commit | 10b6529a2abe78aeb650c5e027cdbad4c2a72219 (patch) | |
tree | 0b4885deb0fbb0e6d09c4058e1c77a0eed8c7eab /canvas | |
parent | 96d551636e9179eb6874a5156b191ef3bff0a10c (diff) |
Use for-range loops (canvas)
Change-Id: I6a3b0b7bd6d4d3f432877e9fab0aadc041a4e8e9
Reviewed-on: https://gerrit.libreoffice.org/50389
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.cxx | 22 | ||||
-rw-r--r-- | canvas/source/vcl/textlayout.cxx | 22 |
2 files changed, 15 insertions, 29 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 2e4e08cfd8c1..c5fd7f615a8a 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -326,14 +326,12 @@ namespace cairocanvas //Pull all the fonts we need to render the text typedef std::pair<SystemFontData,int> FontLevel; std::vector<FontLevel> aFontData; - SystemGlyphDataVector::const_iterator aGlyphIter=aSysLayoutData.rGlyphData.begin(); - const SystemGlyphDataVector::const_iterator aGlyphEnd=aSysLayoutData.rGlyphData.end(); - for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter ) + for (auto const& glyph : aSysLayoutData.rGlyphData) { - if( aFontData.empty() || aGlyphIter->fallbacklevel != aFontData.back().second ) + if( aFontData.empty() || glyph.fallbacklevel != aFontData.back().second ) { - aFontData.emplace_back(rOutDev.GetSysFontData(aGlyphIter->fallbacklevel), - aGlyphIter->fallbacklevel); + aFontData.emplace_back(rOutDev.GetSysFontData(glyph.fallbacklevel), + glyph.fallbacklevel); if( !isCairoRenderable(aFontData.back().first) ) { bCairoRenderable = false; @@ -377,21 +375,17 @@ namespace cairocanvas **/ // Loop through the fonts used and render the matching glyphs for each - std::vector<FontLevel>::const_iterator aFontDataIter = aFontData.begin(); - const std::vector<FontLevel>::const_iterator aFontDataEnd = aFontData.end(); - for( ; aFontDataIter != aFontDataEnd; ++aFontDataIter ) + for (auto const& elemFontData : aFontData) { - const SystemFontData &rSysFontData = aFontDataIter->first; + const SystemFontData &rSysFontData = elemFontData.first; // setup glyphs std::vector<cairo_glyph_t> cairo_glyphs; cairo_glyphs.reserve( 256 ); - aGlyphIter=aSysLayoutData.rGlyphData.begin(); - for( ; aGlyphIter != aGlyphEnd; ++aGlyphIter ) + for (auto const& systemGlyph : aSysLayoutData.rGlyphData) { - SystemGlyphData systemGlyph = *aGlyphIter; - if( systemGlyph.fallbacklevel != aFontDataIter->second ) + if( systemGlyph.fallbacklevel != elemFontData.second ) continue; cairo_glyph_t aGlyph; diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index df6e69407d4d..1a659f463ab7 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -132,15 +132,11 @@ namespace vclcanvas { aOutlineSequence.reserve(aOutlines.size()); sal_Int32 nIndex (0); - for (::basegfx::B2DPolyPolygonVector::const_iterator - iOutline(aOutlines.begin()), - iEnd(aOutlines.end()); - iOutline!=iEnd; - ++iOutline) + for (auto const& outline : aOutlines) { aOutlineSequence[nIndex++] = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxDevice, - *iOutline); + outline); } } @@ -182,17 +178,13 @@ namespace vclcanvas { aBoundingBoxes.realloc(aMetricVector.size()); sal_Int32 nIndex (0); - for (MetricVector::const_iterator - iMetric(aMetricVector.begin()), - iEnd(aMetricVector.end()); - iMetric!=iEnd; - ++iMetric) + for (auto const& metric : aMetricVector) { aBoundingBoxes[nIndex++] = geometry::RealRectangle2D( - iMetric->getX(), - iMetric->getY(), - iMetric->getX() + iMetric->getWidth(), - iMetric->getY() + iMetric->getHeight()); + metric.getX(), + metric.getY(), + metric.getX() + metric.getWidth(), + metric.getY() + metric.getHeight()); } } return aBoundingBoxes; |