diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-14 18:46:41 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-16 20:37:24 +0100 |
commit | 82a0260f9e9ea88301ace2cf8dfa15368f089c74 (patch) | |
tree | 6518f446b2256b7c8fb972e30580f286466f537b /sw | |
parent | 0c2731410ebd8b4414d07b9daf11b3e70f48e1fb (diff) |
move SwClientIter::First() to SwIterator
Change-Id: I165dfaf2894352ad6610855ae9a18bd553ef07be
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/calbck.hxx | 9 | ||||
-rw-r--r-- | sw/inc/switerator.hxx | 10 |
2 files changed, 9 insertions, 10 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index f2ea65651d59..798b4b6d7328 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* First( TypeId nType ) - { - m_aSearchType = nType; - GoStart(); - if(!m_pPosition) - return nullptr; - m_pCurrent = nullptr; - return Next(); - } SwClient* Last( TypeId nType ) { m_aSearchType = nType; diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx index 9cefc921f3b6..3a6a1265289e 100644 --- a/sw/inc/switerator.hxx +++ b/sw/inc/switerator.hxx @@ -28,7 +28,15 @@ template< class TElementType, class TSource > class SwIterator SAL_FINAL public: SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { assert(TElementType::IsOf( TYPE(SwClient) )); } - TElementType* First() { SwClient* p = aClientIter.First(TYPE(TElementType)); return PTR_CAST(TElementType,p); } + TElementType* First() + { + aClientIter.m_aSearchType = TYPE(TElementType); + aClientIter.GoStart(); + if(!aClientIter.m_pPosition) + return nullptr; + aClientIter.m_pCurrent = nullptr; + return PTR_CAST(TElementType,aClientIter.Next()); + } TElementType* Last() { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); } TElementType* Next() { SwClient* p = aClientIter.Next(); return PTR_CAST(TElementType,p); } TElementType* Previous() { SwClient* p = aClientIter.Previous(); return PTR_CAST(TElementType,p); } |