diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-06 10:14:38 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-05-07 12:24:31 +0000 |
commit | 9613b493172fe9aa8efd9c9c090f82ca2e89cf21 (patch) | |
tree | 3cc0d212aea1de270160e295a70c9f08f2e84334 /sc/source/ui/undo/undocell.cxx | |
parent | 464348e82d8cbb0a6d3e5638da3f737f3e6f2d00 (diff) |
clang-tidy modernize-loop-convert in sc
Change-Id: I620028d69b11ea0469efd7b02ac7bbc7edab1066
Reviewed-on: https://gerrit.libreoffice.org/24690
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sc/source/ui/undo/undocell.cxx')
-rw-r--r-- | sc/source/ui/undo/undocell.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 2dbdb4da0ac0..41a5a83e6ca3 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -56,9 +56,9 @@ namespace HelperNotifyChanges { ScRangeList aChangeRanges; - for (size_t i = 0, n = rOldValues.size(); i < n; ++i) + for (const auto & rOldValue : rOldValues) { - aChangeRanges.Append( ScRange(rPos.Col(), rPos.Row(), rOldValues[i].mnTab)); + aChangeRanges.Append( ScRange(rPos.Col(), rPos.Row(), rOldValue.mnTab)); } Notify(*pModelObj, aChangeRanges, "cell-change"); @@ -199,8 +199,8 @@ OUString ScUndoEnterData::GetComment() const void ScUndoEnterData::DoChange() const { // only when needed (old or new Edit cell, or Attribute)? - for (size_t i = 0, n = maOldValues.size(); i < n; ++i) - pDocShell->AdjustRowHeight(maPos.Row(), maPos.Row(), maOldValues[i].mnTab); + for (const auto & i : maOldValues) + pDocShell->AdjustRowHeight(maPos.Row(), maPos.Row(), i.mnTab); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) @@ -219,13 +219,13 @@ void ScUndoEnterData::SetChangeTrack() { mnEndChangeAction = pChangeTrack->GetActionMax() + 1; ScAddress aPos(maPos); - for (size_t i = 0, n = maOldValues.size(); i < n; ++i) + for (Value & rOldValue : maOldValues) { - aPos.SetTab(maOldValues[i].mnTab); + aPos.SetTab(rOldValue.mnTab); sal_uLong nFormat = 0; - if (maOldValues[i].mbHasFormat) - nFormat = maOldValues[i].mnFormat; - pChangeTrack->AppendContent(aPos, maOldValues[i].maCell, nFormat); + if (rOldValue.mbHasFormat) + nFormat = rOldValue.mnFormat; + pChangeTrack->AppendContent(aPos, rOldValue.maCell, nFormat); } if ( mnEndChangeAction > pChangeTrack->GetActionMax() ) mnEndChangeAction = 0; // nothing is appended @@ -239,9 +239,8 @@ void ScUndoEnterData::Undo() BeginUndo(); ScDocument& rDoc = pDocShell->GetDocument(); - for (size_t i = 0, n = maOldValues.size(); i < n; ++i) + for (Value & rVal : maOldValues) { - Value& rVal = maOldValues[i]; ScCellValue aNewCell; aNewCell.assign(rVal.maCell, rDoc, SC_CLONECELL_STARTLISTENING); ScAddress aPos = maPos; @@ -276,9 +275,9 @@ void ScUndoEnterData::Redo() BeginRedo(); ScDocument& rDoc = pDocShell->GetDocument(); - for (size_t i = 0, n = maOldValues.size(); i < n; ++i) + for (Value & rOldValue : maOldValues) { - SCTAB nTab = maOldValues[i].mnTab; + SCTAB nTab = rOldValue.mnTab; if (mpNewEditData) { ScAddress aPos = maPos; |