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

simplify SwClientIter iteration

Change-Id: I078fd3808768cd49190984278207045cc73aa8e6
üst 8152cf6d
......@@ -276,6 +276,14 @@ public:
// otherwise it returns the next SwClient that still is
SwClient* operator()() const
{ return 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
// adding objects to a client chain in iteration is forbidden
......
......@@ -272,24 +272,15 @@ void SwModify::CheckCaching( const sal_uInt16 nWhich )
void SwModify::CallSwClientNotify( const SfxHint& rHint ) const
{
SwClientIter aIter(*this);
SwClient* pClient = aIter.GoStart();
while( pClient )
{
pClient->SwClientNotify( *this, rHint );
pClient = ++aIter;
}
for(SwClientIter aIter(*this); aIter; ++aIter)
aIter->SwClientNotify( *this, rHint );
}
void SwModify::ModifyBroadcast( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue, TypeId nType )
{
SwClientIter aIter( *this );
SwClient* pClient = aIter.First( nType );
while( pClient )
{
pClient->Modify( pOldValue, pNewValue );
pClient = aIter.Next();
}
SwClientIter aIter(*this);
for(aIter.First(nType); aIter; aIter.Next())
aIter->Modify( pOldValue, pNewValue );
}
SwDepend::SwDepend( SwClient* pTellHim, SwModify* pDepend )
......
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