summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r--sw/source/core/unocore/unoobj2.cxx12
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);
}