sc/qa/unit/ucalc_sort.cxx        |    6 +++---
 sc/source/core/data/documen7.cxx |    6 +++---
 sc/source/ui/view/viewdata.cxx   |   18 +++++++++---------
 3 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit 6573ade5cf0cd63ff283446822e3bc87cd8a749b
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue May 31 15:36:24 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue May 31 18:51:58 2022 +0200

    Use some range-based for loops
    
    Change-Id: I26ad6ff194742b69cb6048c48fa01de7715865ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135191
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index bdf2e82d2932..27839c28e1d0 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -573,9 +573,9 @@ void TestSort::testSortInFormulaGroup()
 
     m_pDoc->InsertTab(0, "sorttest");
 
-    for ( SCROW i = 0; i < SCROW(SAL_N_ELEMENTS( aEntries )); ++i )
-        m_pDoc->SetString( aEntries[i].nCol, aEntries[i].nRow, 0,
-                           OUString::createFromAscii( aEntries[i].pData) );
+    for ( auto const & i: aEntries )
+        m_pDoc->SetString( i.nCol, i.nRow, 0,
+                           OUString::createFromAscii( i.pData) );
 
     ScSortParam aSortData;
     aSortData.nCol1 = 0;
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index 28941db7c6d9..61f6b68f0543 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -588,9 +588,9 @@ void ScDocument::TrackFormulas( SfxHintId nHintId )
 void ScDocument::StartAllListeners()
 {
     sc::StartListeningContext aCxt(*this);
-    for ( SCTAB i = 0; i < static_cast<SCTAB>(maTabs.size()); ++i )
-        if ( maTabs[i] )
-            maTabs[i]->StartListeners(aCxt, true);
+    for ( auto const & i: maTabs )
+        if ( i )
+            i->StartListeners(aCxt, true);
 }
 
 void ScDocument::UpdateBroadcastAreas( UpdateRefMode eUpdateRefMode,
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index ac31e522ac79..88d57f106a3b 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1004,10 +1004,10 @@ void ScViewData::SetZoomType( SvxZoomType eNew, 
std::vector< SCTAB >& tabs )
 
     if ( bAll )
     {
-        for ( SCTAB i = 0; i < static_cast<SCTAB>(maTabData.size()); ++i )
+        for ( auto & i: maTabData )
         {
-            if ( maTabData[i] )
-                maTabData[i]->eZoomType = eNew;
+            if ( i )
+                i->eZoomType = eNew;
         }
         eDefZoomType = eNew;
     }
@@ -1046,19 +1046,19 @@ void ScViewData::SetZoom( const Fraction& rNewX, const 
Fraction& rNewY, std::vec
 
     if ( bAll )
     {
-        for ( SCTAB i = 0; i < static_cast<SCTAB>(maTabData.size()); ++i )
+        for ( auto & i: maTabData )
         {
-            if ( maTabData[i] )
+            if ( i )
             {
                 if ( bPagebreak )
                 {
-                    maTabData[i]->aPageZoomX = rNewX;
-                    maTabData[i]->aPageZoomY = rNewY;
+                    i->aPageZoomX = rNewX;
+                    i->aPageZoomY = rNewY;
                 }
                 else
                 {
-                    maTabData[i]->aZoomX = rNewX;
-                    maTabData[i]->aZoomY = rNewY;
+                    i->aZoomX = rNewX;
+                    i->aZoomY = rNewY;
                 }
             }
         }

Reply via email to