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

inline broadcast iterations

Change-Id: If6f83887ad398161d9ccb1e2649ca6cdfd933ca5
üst 9bfd0481
......@@ -155,10 +155,10 @@ public:
// the same, but without setting bModifyLocked or checking for any of the flags
// mba: it would be interesting to know why this is necessary
// also allows to limit callback to certain type (HACK)
void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType = TYPE(SwClient) );
inline void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType = TYPE(SwClient) );
// a more universal broadcasting mechanism
void CallSwClientNotify( const SfxHint& rHint ) const;
inline void CallSwClientNotify( const SfxHint& rHint ) const;
// single argument ctors shall be explicit.
explicit SwModify( SwModify* pToRegisterIn )
......@@ -333,6 +333,19 @@ SwClient::SwClient( SwModify* pToRegisterIn )
if(pToRegisterIn)
pToRegisterIn->Add(this);
}
void SwModify::ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue, TypeId nType)
{
SwClientIter aIter(*this);
for(aIter.First(nType); aIter; aIter.Next())
aIter->Modify( pOldValue, pNewValue );
}
void SwModify::CallSwClientNotify( const SfxHint& rHint ) const
{
for(SwClientIter aIter(*this); aIter; ++aIter)
aIter->SwClientNotify( *this, rHint );
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -270,19 +270,6 @@ void SwModify::CheckCaching( const sal_uInt16 nWhich )
}
}
void SwModify::CallSwClientNotify( const SfxHint& rHint ) const
{
for(SwClientIter aIter(*this); aIter; ++aIter)
aIter->SwClientNotify( *this, rHint );
}
void SwModify::ModifyBroadcast( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue, TypeId nType )
{
SwClientIter aIter(*this);
for(aIter.First(nType); aIter; aIter.Next())
aIter->Modify( pOldValue, pNewValue );
}
SwDepend::SwDepend( SwClient* pTellHim, SwModify* pDepend )
: SwClient( 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