summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-14 18:52:36 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-16 20:37:24 +0100
commita583f445cfca85bd9a8692154774d08f28d9a508 (patch)
treecc8d4fc3f058a80e3122a6a7357a65788360837e
parent82a0260f9e9ea88301ace2cf8dfa15368f089c74 (diff)
Move SwClientIter::Last() to SwIterator
Change-Id: I7ec3feaec7a07871a3470f7f41dd203fa0f83fd0
-rw-r--r--sw/inc/calbck.hxx10
-rw-r--r--sw/inc/switerator.hxx11
2 files changed, 10 insertions, 11 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 798b4b6d7328..81dc18170875 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -263,16 +263,6 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter>
static SW_DLLPUBLIC SwClientIter* our_pClientIters;
- SwClient* Last( TypeId nType )
- {
- m_aSearchType = nType;
- GoEnd();
- if(!m_pPosition)
- return nullptr;
- if( m_pPosition->IsA( m_aSearchType ) )
- return m_pPosition;
- return Previous();
- }
SwClient* Next()
{
if( m_pPosition == m_pCurrent )
diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx
index 3a6a1265289e..a054d0780db7 100644
--- a/sw/inc/switerator.hxx
+++ b/sw/inc/switerator.hxx
@@ -37,7 +37,16 @@ public:
aClientIter.m_pCurrent = nullptr;
return PTR_CAST(TElementType,aClientIter.Next());
}
- TElementType* Last() { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); }
+ TElementType* Last()
+ {
+ aClientIter.m_aSearchType = TYPE(TElementType);
+ GoEnd();
+ if(!aClientIter.m_pPosition)
+ return nullptr;
+ if(aClientIter.m_pPosition->IsA(TYPE(TElementType))
+ 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* 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); }