Kaydet (Commit) b76943b0 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

simplify SwClient::Previous() more

Change-Id: If0e80981f248a3a388934025a90502290d5f3c47
üst daddc797
...@@ -444,6 +444,8 @@ SwClient* SwClientIter::Last( TypeId nType ) ...@@ -444,6 +444,8 @@ SwClient* SwClientIter::Last( TypeId nType )
{ {
aSrchId = nType; aSrchId = nType;
GoEnd(); GoEnd();
if(!pDelNext)
return nullptr;
if( pDelNext && pDelNext->IsA( aSrchId ) ) if( pDelNext && pDelNext->IsA( aSrchId ) )
return pDelNext; return pDelNext;
return Previous(); return Previous();
...@@ -460,12 +462,9 @@ SwClient* SwClientIter::Next() ...@@ -460,12 +462,9 @@ SwClient* SwClientIter::Next()
SwClient* SwClientIter::Previous() SwClient* SwClientIter::Previous()
{ {
while(pDelNext)
{
pDelNext = static_cast<SwClient*>(pDelNext->m_pLeft); pDelNext = static_cast<SwClient*>(pDelNext->m_pLeft);
if( pDelNext && pDelNext->IsA( aSrchId ) ) while(pDelNext && !pDelNext->IsA( aSrchId ) )
break; pDelNext = static_cast<SwClient*>(pDelNext->m_pLeft);
}
return pAct = pDelNext; return pAct = pDelNext;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment