summaryrefslogtreecommitdiff
path: root/svtools/source/contnr
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-02-08 11:09:15 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-02-08 18:31:34 +0100
commit0fb4ae8767fa5ff791cd42934b4215011a269eb0 (patch)
tree90c10a3b8f566d4f008675f2dbf5b7b07af8158e /svtools/source/contnr
parent275c1e0a05c1d31c9d83a246082a59db3119059d (diff)
Modernize a bit svtools
by using for-range loops + use empty() instead of comparing begin and end iterator Change-Id: I41c3ae0c9032d6349afb113d457cb78862ae9dcf Reviewed-on: https://gerrit.libreoffice.org/49416 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'svtools/source/contnr')
-rw-r--r--svtools/source/contnr/svtabbx.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index 8f871e41ea8a..092725983735 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -1153,10 +1153,12 @@ sal_Int32 SvHeaderTabListBox::GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nC
MetricVector aRects;
if ( GetGlyphBoundRects(Point(0,0), sText, 0, sText.getLength(), aRects) )
{
- for (MetricVector::iterator aIter = aRects.begin(); aIter != aRects.end(); ++aIter)
+ sal_Int32 nPos = 0;
+ for (auto const& rectangle : aRects)
{
- if( aIter->IsInside(_rPoint) )
- return aIter - aRects.begin();
+ if( rectangle.IsInside(_rPoint) )
+ return nPos;
+ ++nPos;
}
}