diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-25 19:46:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-26 15:26:24 +0200 |
commit | ae5d6e44ce2310ef3ec4b0d12fe2d0005567a1ef (patch) | |
tree | 74e3cb03b63ad789247e9d20725f4c27d8677492 /sc | |
parent | 7b52990a234bfd6d4efcbc9fe51e240e065faeea (diff) |
get rid of aEndItr entirely
Change-Id: Ib95ca628457d7330ac1e1001ab13a00a764c9bad
Reviewed-on: https://gerrit.libreoffice.org/59598
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index 32108b58104e..a29c78c6a476 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -744,45 +744,43 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc) // old files didn't store nanoseconds, disable until encountered pTrack->SetTimeNanoSeconds( false ); - auto aItr(aActions.begin()); - auto aEndItr(aActions.end()); - while (aItr != aEndItr) + for (const auto & rAction : aActions) { std::unique_ptr<ScChangeAction> pAction; - switch ((*aItr)->nActionType) + switch (rAction->nActionType) { case SC_CAT_INSERT_COLS: case SC_CAT_INSERT_ROWS: case SC_CAT_INSERT_TABS: { - pAction = CreateInsertAction(static_cast<ScMyInsAction*>(aItr->get())); + pAction = CreateInsertAction(static_cast<ScMyInsAction*>(rAction.get())); } break; case SC_CAT_DELETE_COLS: case SC_CAT_DELETE_ROWS: case SC_CAT_DELETE_TABS: { - ScMyDelAction* pDelAct = static_cast<ScMyDelAction*>(aItr->get()); + ScMyDelAction* pDelAct = static_cast<ScMyDelAction*>(rAction.get()); pAction = CreateDeleteAction(pDelAct); CreateGeneratedActions(pDelAct->aGeneratedList); } break; case SC_CAT_MOVE: { - ScMyMoveAction* pMovAct = static_cast<ScMyMoveAction*>(aItr->get()); + ScMyMoveAction* pMovAct = static_cast<ScMyMoveAction*>(rAction.get()); pAction = CreateMoveAction(pMovAct); CreateGeneratedActions(pMovAct->aGeneratedList); } break; case SC_CAT_CONTENT: { - pAction = CreateContentAction(static_cast<ScMyContentAction*>(aItr->get())); + pAction = CreateContentAction(static_cast<ScMyContentAction*>(rAction.get())); } break; case SC_CAT_REJECT: { - pAction = CreateRejectionAction(static_cast<ScMyRejAction*>(aItr->get())); + pAction = CreateRejectionAction(static_cast<ScMyRejAction*>(rAction.get())); } break; default: @@ -797,13 +795,11 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc) { OSL_FAIL("no action"); } - - ++aItr; } if (pTrack->GetLast()) pTrack->SetActionMax(pTrack->GetLast()->GetActionNumber()); - aItr = aActions.begin(); + auto aItr = aActions.begin(); while (aItr != aActions.end()) { SetDependencies(aItr->get()); |