summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-14 18:46:41 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-16 20:37:24 +0100
commit82a0260f9e9ea88301ace2cf8dfa15368f089c74 (patch)
tree6518f446b2256b7c8fb972e30580f286466f537b
parent0c2731410ebd8b4414d07b9daf11b3e70f48e1fb (diff)
move SwClientIter::First() to SwIterator
Change-Id: I165dfaf2894352ad6610855ae9a18bd553ef07be
-rw-r--r--sw/inc/calbck.hxx9
-rw-r--r--sw/inc/switerator.hxx10
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); }