Kaydet (Commit) cc27d038 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: prefix members of SwClient

Change-Id: If35981bce951dfab4a784d4cb54ac911249572ed
üst 9c76f393
......@@ -100,18 +100,18 @@ class SW_DLLPUBLIC SwClient : public ::sw::WriterListener
friend class sw::ClientIteratorBase;
template<typename E, typename S> friend class SwIterator;
SwModify *pRegisteredIn; ///< event source
SwModify *m_pRegisteredIn; ///< event source
protected:
// single argument ctors shall be explicit.
inline explicit SwClient( SwModify* pToRegisterIn );
// write access to pRegisteredIn shall be granted only to the object itself (protected access)
SwModify* GetRegisteredInNonConst() const { return pRegisteredIn; }
SwModify* GetRegisteredInNonConst() const { return m_pRegisteredIn; }
public:
SwClient() : pRegisteredIn(nullptr) {}
SwClient() : m_pRegisteredIn(nullptr) {}
virtual ~SwClient() override;
// callbacks received from SwModify (friend class - so these methods can be private)
// should be called only from SwModify the client is registered in
......@@ -130,8 +130,8 @@ public:
void ModifyNotification( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue ) { this->Modify ( pOldValue, pNewValue ); }
void SwClientNotifyCall( const SwModify& rModify, const SfxHint& rHint ) { SwClientNotify( rModify, rHint ); }
const SwModify* GetRegisteredIn() const { return pRegisteredIn; }
SwModify* GetRegisteredIn() { return pRegisteredIn; }
const SwModify* GetRegisteredIn() const { return m_pRegisteredIn; }
SwModify* GetRegisteredIn() { return m_pRegisteredIn; }
// get information about attribute
......@@ -342,7 +342,7 @@ public:
};
SwClient::SwClient( SwModify* pToRegisterIn )
: pRegisteredIn( nullptr )
: m_pRegisteredIn( nullptr )
{
if(pToRegisterIn)
pToRegisterIn->Add(this);
......
......@@ -31,9 +31,9 @@ SwClient::~SwClient()
{
if(GetRegisteredIn())
DBG_TESTSOLARMUTEX();
OSL_ENSURE( !pRegisteredIn || pRegisteredIn->HasWriterListeners(), "SwModify still known, but Client already disconnected!" );
if( pRegisteredIn && pRegisteredIn->HasWriterListeners() )
pRegisteredIn->Remove( this );
OSL_ENSURE( !m_pRegisteredIn || m_pRegisteredIn->HasWriterListeners(), "SwModify still known, but Client already disconnected!" );
if( m_pRegisteredIn && m_pRegisteredIn->HasWriterListeners() )
m_pRegisteredIn->Remove( this );
}
void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* )
......@@ -44,10 +44,10 @@ void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* )
return;
const SwPtrMsgPoolItem* pDead = static_cast<const SwPtrMsgPoolItem*>(pOld);
if(pDead && pDead->pObject == pRegisteredIn)
if(pDead && pDead->pObject == m_pRegisteredIn)
{
// I've got a notification from the object I know
SwModify* pAbove = pRegisteredIn->GetRegisteredIn();
SwModify* pAbove = m_pRegisteredIn->GetRegisteredIn();
if(pAbove)
{
// if the dying object itself was listening at an SwModify, I take over
......@@ -56,7 +56,7 @@ void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* )
return;
}
// destroy connection
pRegisteredIn->Remove(this);
m_pRegisteredIn->Remove(this);
}
}
......@@ -80,7 +80,7 @@ void SwModify::SetInDocDTOR()
// later when they also get destroyed
SwIterator<SwClient,SwModify> aIter(*this);
for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next())
pClient->pRegisteredIn = nullptr;
pClient->m_pRegisteredIn = nullptr;
m_pWriterListeners = nullptr;
}
......@@ -160,7 +160,7 @@ void SwModify::Add( SwClient* pDepend )
DBG_TESTSOLARMUTEX();
OSL_ENSURE( !m_bLockClientList, "Client inserted while in Modify" );
if(pDepend->pRegisteredIn != this )
if(pDepend->m_pRegisteredIn != this )
{
#if OSL_DEBUG_LEVEL > 0
if(sw::ClientIteratorBase::our_pClientIters)
......@@ -172,8 +172,8 @@ void SwModify::Add( SwClient* pDepend )
}
#endif
// deregister new client in case it is already registered elsewhere
if( pDepend->pRegisteredIn != nullptr )
pDepend->pRegisteredIn->Remove( pDepend );
if( pDepend->m_pRegisteredIn != nullptr )
pDepend->m_pRegisteredIn->Remove( pDepend );
if( !m_pWriterListeners )
{
......@@ -193,14 +193,14 @@ void SwModify::Add( SwClient* pDepend )
}
// connect client to me
pDepend->pRegisteredIn = this;
pDepend->m_pRegisteredIn = this;
}
}
SwClient* SwModify::Remove( SwClient* pDepend )
{
DBG_TESTSOLARMUTEX();
assert(pDepend->pRegisteredIn == this);
assert(pDepend->m_pRegisteredIn == this);
// SwClient is my listener
// remove it from my list
......@@ -229,7 +229,7 @@ SwClient* SwModify::Remove( SwClient* pDepend )
}
pDepend->m_pLeft = nullptr;
pDepend->m_pRight = nullptr;
pDepend->pRegisteredIn = nullptr;
pDepend->m_pRegisteredIn = nullptr;
return 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