summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-14 19:01:48 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-16 20:37:25 +0100
commit32d322a133960a0533403581df1ba7251b7dc700 (patch)
tree3cf2026b0bb73994005dd81bb6425f27934b5c4b
parenta583f445cfca85bd9a8692154774d08f28d9a508 (diff)
Move SwClientIter::Next() to SwIterator
Change-Id: I7e0a9d1a02fa91fd2d685c3c6c1c3340be5cf41d
-rw-r--r--sw/inc/calbck.hxx9
-rw-r--r--sw/inc/switerator.hxx9
2 files changed, 8 insertions, 10 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 81dc18170875..bde2e5bff95d 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -263,15 +263,6 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter>
static SW_DLLPUBLIC SwClientIter* our_pClientIters;
- SwClient* Next()
- {
- if( m_pPosition == m_pCurrent )
- m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight);
- while(m_pPosition && !m_pPosition->IsA( m_aSearchType ) )
- m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight);
- return m_pCurrent = m_pPosition;
- }
-
SwClient* Previous()
{
m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft);
diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx
index a054d0780db7..fd943ba54cea 100644
--- a/sw/inc/switerator.hxx
+++ b/sw/inc/switerator.hxx
@@ -47,7 +47,14 @@ public:
return PTR_CAST(TElementType,aClientIter.m_pPosition);
return PTR_CAST(TElementType,aClientIter.Previous());
}
- TElementType* Next() { SwClient* p = aClientIter.Next(); return PTR_CAST(TElementType,p); }
+ TElementType* Next()
+ {
+ if( aClientIter.m_pPosition == aClientIter.m_pCurrent )
+ aClientIter.m_pPosition = static_cast<SwClient*>(aClientIter.m_pPosition->m_pRight);
+ while(aClientIter.m_pPosition && !aClientIter.m_pPosition->IsA( TYPE(TElementType) ) )
+ aClientIter.m_pPosition = static_cast<SwClient*>(aClientIter.m_pPosition->m_pRight);
+ return PTR_CAST(TElementType,aClientIter.m_pCurrent = aClientIter.m_pPosition);
+ }
TElementType* Previous() { SwClient* p = aClientIter.Previous(); return PTR_CAST(TElementType,p); }
static TElementType* FirstElement( const TSource& rMod ) { SwClient* p = SwClientIter(rMod).First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
bool IsChanged() { return aClientIter.IsChanged(); }