sc/source/core/data/documen2.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 8d4faf8fc232d01b4bea435ec9301e0e1f916ee8
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Mon Jul 7 23:57:43 2025 +0200
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Sun Jul 13 08:38:39 2025 +0200

    sc: use auto for iterators to simplify the code
    
    Change-Id: I0f6c7a2c68e4a1cbfaf16ba548015f003901a8de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187739
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 16ca4c7d16f8..f513239ffe83 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -870,21 +870,27 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, 
const ScMarkData* pOnlyM
                 if ( pUnoBroadcaster )
                     pUnoBroadcaster->Broadcast( ScUpdateRefHint( URM_INSDEL, 
aRange, 0,0,1 ) );
 
-                for (TableContainer::iterator it = maTabs.begin(); it != 
maTabs.end(); ++it)
+                for (auto it = maTabs.begin(); it != maTabs.end(); ++it)
+                {
                     if (*it && it != (maTabs.begin() + nOldPos))
                         (*it)->UpdateInsertTab(aCxt);
+                }
                 if (nNewPos <= nOldPos)
                     nOldPos++;
                 maTabs.emplace(maTabs.begin() + nNewPos, new ScTable(*this, 
nNewPos, aName));
                 bValid = true;
-                for (TableContainer::iterator it = maTabs.begin(); it != 
maTabs.end(); ++it)
+                for (auto it = maTabs.begin(); it != maTabs.end(); ++it)
+                {
                     if (*it && it != maTabs.begin()+nOldPos && it != 
maTabs.begin() + nNewPos)
                         (*it)->UpdateCompile();
+                }
                 SetNoListening( false );
                 sc::StartListeningContext aSLCxt(*this);
-                for (TableContainer::iterator it = maTabs.begin(); it != 
maTabs.end(); ++it)
+                for (auto it = maTabs.begin(); it != maTabs.end(); ++it)
+                {
                     if (*it && it != maTabs.begin()+nOldPos && it != 
maTabs.begin()+nNewPos)
                         (*it)->StartListeners(aSLCxt, true);
+                }
 
                 if (pValidationList)
                     pValidationList->UpdateInsertTab(aCxt);

Reply via email to