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

remove superficial helpers

Change-Id: Icd690bf20c47152b00e1f51586471f9fe029c4cf
üst a5fead9c
...@@ -285,23 +285,6 @@ public: ...@@ -285,23 +285,6 @@ public:
our_pClientIters = unique() ? nullptr : GetNextInRing(); our_pClientIters = unique() ? nullptr : GetNextInRing();
MoveTo(nullptr); MoveTo(nullptr);
} }
SwClient* operator++()
{
if( m_pPosition == m_pCurrent )
m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight);
return m_pCurrent = m_pPosition;
}
// returns the current SwClient object, wether it is still a client or not
SwClient& operator*() const
{ return *m_pCurrent; }
// returns the current SwClient object, wether it is still a client or not
SwClient* operator->() const
{ return m_pCurrent; }
explicit operator bool() const
{ return m_pCurrent!=nullptr; }
// return "true" if an object was removed from a client chain in iteration // return "true" if an object was removed from a client chain in iteration
// adding objects to a client chain in iteration is forbidden // adding objects to a client chain in iteration is forbidden
// SwModify::Add() asserts this // SwModify::Add() asserts this
...@@ -401,23 +384,19 @@ SwClient::SwClient( SwModify* pToRegisterIn ) ...@@ -401,23 +384,19 @@ SwClient::SwClient( SwModify* pToRegisterIn )
void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType) void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType)
{ {
SwClientIter aIter(*this); SwIterator<SwClient,SwModify> aIter(*this);
aIter.GoStart(); for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next())
while(aIter)
{ {
if( aIter.m_pPosition == aIter.m_pCurrent ) if(pClient->IsA(nType))
aIter.m_pPosition = static_cast<SwClient*>(aIter.m_pPosition->m_pRight); pClient->Modify( pOldValue, pNewValue );
while(aIter.m_pPosition && !aIter.m_pPosition->IsA( nType ) )
aIter.m_pPosition = static_cast<SwClient*>(aIter.m_pPosition->m_pRight);
aIter.m_pCurrent = aIter.m_pPosition;
aIter->Modify( pOldValue, pNewValue );
} }
} }
void SwModify::CallSwClientNotify( const SfxHint& rHint ) const void SwModify::CallSwClientNotify( const SfxHint& rHint ) const
{ {
for(SwClientIter aIter(*this); aIter; ++aIter) SwIterator<SwClient,SwModify> aIter(*this);
aIter->SwClientNotify( *this, rHint ); for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next())
pClient->SwClientNotify( *this, rHint );
} }
#endif #endif
......
...@@ -74,9 +74,9 @@ SwModify::~SwModify() ...@@ -74,9 +74,9 @@ SwModify::~SwModify()
// If the document gets destroyed anyway, just tell clients to // If the document gets destroyed anyway, just tell clients to
// forget me so that they don't try to get removed from my list // forget me so that they don't try to get removed from my list
// later when they also get destroyed // later when they also get destroyed
SwClientIter aIter( *this ); SwIterator<SwClient,SwModify> aIter(*this);
for(aIter.GoStart(); aIter; ++aIter) for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next())
aIter->pRegisteredIn = nullptr; pClient->pRegisteredIn = nullptr;
} }
else else
{ {
...@@ -134,9 +134,9 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const ...@@ -134,9 +134,9 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
{ {
if(!pRoot) if(!pRoot)
return true; return true;
SwClientIter aIter( *const_cast<SwModify*>(this) ); SwIterator<SwClient,SwModify> aIter(*this);
for(aIter.GoStart(); aIter; ++aIter) for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next())
if(!aIter->GetInfo( rInfo )) if(!pClient->GetInfo( rInfo ))
return false; return false;
return true; return true;
} }
......
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