diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-03 18:46:13 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-04 01:09:57 +0100 |
commit | 001180222a995b2b76900d1de9ddf3c844037edc (patch) | |
tree | 2450621a0333c4060e76eba7f7eda0b09d030ecd /sw/source/core/unocore | |
parent | ec47c1b80b264e21b6ee6ffe00ca2fa6d82b5396 (diff) |
use C++11 iteration
Change-Id: I1a892b13d8716c9963f344bb57febbc7118561b2
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 883ff5cb589d..49d460000dbc 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -315,17 +315,15 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam, { pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL); - SwPaM *pCurrent = &rPam; - do + for(SwPaM& rCurrent : rPam.GetRingContainer()) { - if (pCurrent->HasMark() && + if (rCurrent.HasMark() && ( (bTableMode) || - (*pCurrent->GetPoint() != *pCurrent->GetMark()) )) + (*rCurrent.GetPoint() != *rCurrent.GetMark()) )) { - pDoc->getIDocumentContentOperations().InsertItemSet(*pCurrent, rSet, nFlags); + pDoc->getIDocumentContentOperations().InsertItemSet(rCurrent, rSet, nFlags); } - pCurrent= static_cast<SwPaM *>(pCurrent->GetNext()); - } while (pCurrent != &rPam); + } pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSATTR, NULL); } |