diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-11-14 00:57:07 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-14 09:58:55 +0100 |
commit | 25622f29b4003307d2ba780ff1232d8b7cdafa35 (patch) | |
tree | ad15c747685e803deeb5fffd209ae0b5992ac87a /sw/source/core/layout/paintfrm.cxx | |
parent | 638d619866784510dcbf0cadb6eb251208489a73 (diff) |
Simplify containers iterations in sw/source/core/[d-l]*
Use range-based loop or replace with STL functions
Change-Id: I143e9a769e1c1bb0228933a0a92150f00e3e1f20
Reviewed-on: https://gerrit.libreoffice.org/63347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/layout/paintfrm.cxx')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index bfb80dbd8de8..67979b8d4984 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1052,10 +1052,8 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, pOut->SetDrawMode( DrawModeFlags::Default ); } - for (SwSubsRects::iterator it = aLineRects.begin(); it != aLineRects.end(); - ++it) + for (SwLineRect& rLRect : aLineRects) { - SwLineRect &rLRect = (*it); // Add condition <!rLRect.IsLocked()> to prevent paint of locked subsidiary lines. if ( !rLRect.IsPainted() && !rLRect.IsLocked() ) @@ -2399,11 +2397,9 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons break; const SwLineEntrySet& rEntrySet = (*aIter).second; - for (SwLineEntrySet::const_iterator aSetIter = rEntrySet.begin(); - aSetIter != rEntrySet.end(); ++aSetIter) + for (const SwLineEntry& rEntry : rEntrySet) { - const SwLineEntry& rEntry = *aSetIter; - const svx::frame::Style& rEntryStyle( (*aSetIter).maAttribute ); + const svx::frame::Style& rEntryStyle( rEntry.maAttribute ); Point aStart, aEnd; if ( bHori ) @@ -2607,11 +2603,9 @@ void SwTabFramePainter::FindStylesForLine( const Point& rStartPoint, SwLineEntryMap::const_iterator aMapIter = maVertLines.find( rStartPoint.X() ); OSL_ENSURE( aMapIter != maVertLines.end(), "FindStylesForLine: Error" ); const SwLineEntrySet& rVertSet = (*aMapIter).second; - SwLineEntrySet::const_iterator aIter = rVertSet.begin(); - while ( aIter != rVertSet.end() ) + for ( const SwLineEntry& rEntry : rVertSet ) { - const SwLineEntry& rEntry = *aIter; if ( bHori ) { if ( rStartPoint.Y() == rEntry.mnStartPos ) @@ -2626,17 +2620,14 @@ void SwTabFramePainter::FindStylesForLine( const Point& rStartPoint, else if ( rEndPoint.Y() == rEntry.mnStartPos ) pStyles[ 5 ] = rEntry.maAttribute; } - ++aIter; } aMapIter = maHoriLines.find( rStartPoint.Y() ); OSL_ENSURE( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" ); const SwLineEntrySet& rHoriSet = (*aMapIter).second; - aIter = rHoriSet.begin(); - while ( aIter != rHoriSet.end() ) + for ( const SwLineEntry& rEntry : rHoriSet ) { - const SwLineEntry& rEntry = *aIter; if ( bHori ) { if ( rStartPoint.X() == rEntry.mnEndPos ) @@ -2651,7 +2642,6 @@ void SwTabFramePainter::FindStylesForLine( const Point& rStartPoint, else if ( rStartPoint.X() == rEntry.mnStartPos ) pStyles[ 3 ] = rEntry.maAttribute; } - ++aIter; } if ( bHori ) @@ -2659,16 +2649,13 @@ void SwTabFramePainter::FindStylesForLine( const Point& rStartPoint, aMapIter = maVertLines.find( rEndPoint.X() ); OSL_ENSURE( aMapIter != maVertLines.end(), "FindStylesForLine: Error" ); const SwLineEntrySet& rVertSet2 = (*aMapIter).second; - aIter = rVertSet2.begin(); - while ( aIter != rVertSet2.end() ) + for ( const SwLineEntry& rEntry : rVertSet2 ) { - const SwLineEntry& rEntry = *aIter; if ( rEndPoint.Y() == rEntry.mnStartPos ) pStyles[ 6 ] = rEntry.maAttribute; else if ( rEndPoint.Y() == rEntry.mnEndPos ) pStyles[ 4 ] = rEntry.maAttribute; - ++aIter; } } else @@ -2676,16 +2663,13 @@ void SwTabFramePainter::FindStylesForLine( const Point& rStartPoint, aMapIter = maHoriLines.find( rEndPoint.Y() ); OSL_ENSURE( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" ); const SwLineEntrySet& rHoriSet2 = (*aMapIter).second; - aIter = rHoriSet2.begin(); - while ( aIter != rHoriSet2.end() ) + for ( const SwLineEntry& rEntry : rHoriSet2 ) { - const SwLineEntry& rEntry = *aIter; if ( rEndPoint.X() == rEntry.mnEndPos ) pStyles[ 4 ] = rEntry.maAttribute; else if ( rEndPoint.X() == rEntry.mnStartPos ) pStyles[ 6 ] = rEntry.maAttribute; - ++aIter; } } } |