sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 20 ++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-)
New commits: commit ae5d6e44ce2310ef3ec4b0d12fe2d0005567a1ef Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Aug 25 19:46:30 2018 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Aug 26 15:26:24 2018 +0200 get rid of aEndItr entirely Change-Id: Ib95ca628457d7330ac1e1001ab13a00a764c9bad Reviewed-on: https://gerrit.libreoffice.org/59598 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> 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()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits