summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbaapplication.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-01-06 15:02:59 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-07 07:24:05 +0100
commit892a5cfe557edb405ec0037676f02a1c24dd76ec (patch)
treebb023d0858cd0f34ded726e2b54933a2481cc6b1 /sc/source/ui/vba/vbaapplication.cxx
parent4cd19e16ce24cd244e3a5a3c23add91a8f980790 (diff)
Simplify containers iterations in sc/source/ui/{unoobj,vba}
Use range-based loop or replace with STL functions Change-Id: Ia8a8cfb71047e5612aa62c817c76ae0dfb7b3fa2 Reviewed-on: https://gerrit.libreoffice.org/65903 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/vba/vbaapplication.cxx')
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 57d61297d842..2ae5b7b208fd 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -1124,19 +1124,19 @@ void lclIntersectRanges( ListOfScRange& rList, const uno::Any& rArg )
// join ranges from passed argument
lclJoinRanges( aList2 );
// calculate intersection of the ranges in both lists
- for( ListOfScRange::const_iterator aOuterIt = aList1.begin(), aOuterEnd = aList1.end(); aOuterIt != aOuterEnd; ++aOuterIt )
+ for( const auto& rOuterItem : aList1 )
{
- for( ListOfScRange::const_iterator aInnerIt = aList2.begin(), aInnerEnd = aList2.end(); aInnerIt != aInnerEnd; ++aInnerIt )
+ for( const auto& rInnerItem : aList2 )
{
- if( aOuterIt->Intersects( *aInnerIt ) )
+ if( rOuterItem.Intersects( rInnerItem ) )
{
ScRange aIsectRange(
- std::max( aOuterIt->aStart.Col(), aInnerIt->aStart.Col() ),
- std::max( aOuterIt->aStart.Row(), aInnerIt->aStart.Row() ),
- std::max( aOuterIt->aStart.Tab(), aInnerIt->aStart.Tab() ),
- std::min( aOuterIt->aEnd.Col(), aInnerIt->aEnd.Col() ),
- std::min( aOuterIt->aEnd.Row(), aInnerIt->aEnd.Row() ),
- std::min( aOuterIt->aEnd.Tab(), aInnerIt->aEnd.Tab() ) );
+ std::max( rOuterItem.aStart.Col(), rInnerItem.aStart.Col() ),
+ std::max( rOuterItem.aStart.Row(), rInnerItem.aStart.Row() ),
+ std::max( rOuterItem.aStart.Tab(), rInnerItem.aStart.Tab() ),
+ std::min( rOuterItem.aEnd.Col(), rInnerItem.aEnd.Col() ),
+ std::min( rOuterItem.aEnd.Row(), rInnerItem.aEnd.Row() ),
+ std::min( rOuterItem.aEnd.Tab(), rInnerItem.aEnd.Tab() ) );
rList.push_back( aIsectRange );
}
}
@@ -1159,8 +1159,8 @@ uno::Reference< excel::XRange > lclCreateVbaRange(
if( !pDocShell ) throw uno::RuntimeException();
ScRangeList aCellRanges;
- for( ListOfScRange::const_iterator aIt = rList.begin(), aEnd = rList.end(); aIt != aEnd; ++aIt )
- aCellRanges.push_back( *aIt );
+ for( const auto& rItem : rList )
+ aCellRanges.push_back( rItem );
if( aCellRanges.size() == 1 )
{