summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-03 23:11:23 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-04 01:09:58 +0100
commit6e778991147395b7385decf797c75051da08e29d (patch)
treeb557a853c247b21c353667bf485e506a85e18d75 /sw
parent1de19df963513a3f78e5bd4a73c059f1c32c599d (diff)
use C++11 iteration
Change-Id: I8f12726aee31dd123861340a85f247ba546bf8a8
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unoobj2.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 45f95e543bdc..ec47affffb87 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1536,22 +1536,19 @@ void SwXTextRanges::Impl::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pN
void SwXTextRanges::Impl::MakeRanges()
{
- SwUnoCrsr *const pCursor = GetCursor();
- if (pCursor)
+ if (GetCursor())
{
- SwPaM *pTmpCursor = pCursor;
- do {
+ for(SwPaM& rTmpCursor : GetCursor()->GetRingContainer())
+ {
const uno::Reference< text::XTextRange > xRange(
SwXTextRange::CreateXTextRange(
- *pTmpCursor->GetDoc(),
- *pTmpCursor->GetPoint(), pTmpCursor->GetMark()));
+ *rTmpCursor.GetDoc(),
+ *rTmpCursor.GetPoint(), rTmpCursor.GetMark()));
if (xRange.is())
{
m_Ranges.push_back(xRange);
}
- pTmpCursor = static_cast<SwPaM*>(pTmpCursor->GetNext());
}
- while (pTmpCursor != pCursor);
}
}