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

code convention: member names

Conflicts:
	sw/inc/calbck.hxx

Change-Id: I0322261240bee8795e23669306fb846da0ea706f
üst b8d56471
...@@ -156,12 +156,12 @@ class SW_DLLPUBLIC SwModify: public SwClient ...@@ -156,12 +156,12 @@ class SW_DLLPUBLIC SwModify: public SwClient
{ {
friend class sw::ClientIteratorBase; friend class sw::ClientIteratorBase;
template<typename E, typename S> friend class SwIterator; template<typename E, typename S> friend class SwIterator;
sw::WriterListener* pRoot; // the start of the linked list of clients sw::WriterListener* m_pWriterListeners; // the start of the linked list of clients
bool bModifyLocked : 1; // don't broadcast changes now bool m_bModifyLocked : 1; // don't broadcast changes now
bool bLockClientList : 1; // may be set when this instance notifies its clients bool bLockClientList : 1; // may be set when this instance notifies its clients
bool bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed bool m_bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed
bool bInCache : 1; bool m_bInCache : 1;
bool bInSwFntCache : 1; bool m_bInSwFntCache : 1;
// mba: IMHO this method should be pure virtual // mba: IMHO this method should be pure virtual
// DO NOT USE IN NEW CODE! use CallSwClientNotify instead. // DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
...@@ -170,10 +170,10 @@ class SW_DLLPUBLIC SwModify: public SwClient ...@@ -170,10 +170,10 @@ class SW_DLLPUBLIC SwModify: public SwClient
public: public:
SwModify() SwModify()
: SwClient(nullptr), pRoot(nullptr), bModifyLocked(false), bLockClientList(false), bInDocDTOR(false), bInCache(false), bInSwFntCache(false) : SwClient(nullptr), m_pWriterListeners(nullptr), m_bModifyLocked(false), bLockClientList(false), m_bInDocDTOR(false), m_bInCache(false), m_bInSwFntCache(false)
{} {}
explicit SwModify( SwModify* pToRegisterIn ) explicit SwModify( SwModify* pToRegisterIn )
: SwClient(pToRegisterIn), pRoot(nullptr), bModifyLocked(false), bLockClientList(false), bInDocDTOR(false), bInCache(false), bInSwFntCache(false) : SwClient(pToRegisterIn), m_pWriterListeners(nullptr), m_bModifyLocked(false), bLockClientList(false), m_bInDocDTOR(false), m_bInCache(false), m_bInSwFntCache(false)
{} {}
// broadcasting: send notifications to all clients // broadcasting: send notifications to all clients
...@@ -182,7 +182,7 @@ public: ...@@ -182,7 +182,7 @@ public:
// DO NOT USE IN NEW CODE! use CallSwClientNotify instead. // DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue) void ModifyBroadcast( const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
{ CallSwClientNotify( sw::LegacyModifyHint{ pOldValue, pNewValue } ); }; { CallSwClientNotify( sw::LegacyModifyHint{ pOldValue, pNewValue } ); };
// the same, but without setting bModifyLocked or checking for any of the flags // the same, but without setting m_bModifyLocked or checking for any of the flags
// mba: it would be interesting to know why this is necessary // mba: it would be interesting to know why this is necessary
// also allows to limit callback to certain type (HACK) // also allows to limit callback to certain type (HACK)
// DO NOT USE IN NEW CODE! use CallSwClientNotify instead. // DO NOT USE IN NEW CODE! use CallSwClientNotify instead.
...@@ -195,23 +195,23 @@ public: ...@@ -195,23 +195,23 @@ public:
void Add(SwClient *pDepend); void Add(SwClient *pDepend);
SwClient* Remove(SwClient *pDepend); SwClient* Remove(SwClient *pDepend);
bool HasWriterListeners() const { return pRoot; } bool HasWriterListeners() const { return m_pWriterListeners; }
// get information about attribute // get information about attribute
virtual bool GetInfo( SfxPoolItem& ) const SAL_OVERRIDE; virtual bool GetInfo( SfxPoolItem& ) const SAL_OVERRIDE;
void LockModify() { bModifyLocked = true; } void LockModify() { m_bModifyLocked = true; }
void UnlockModify() { bModifyLocked = false; } void UnlockModify() { m_bModifyLocked = false; }
void SetInCache( bool bNew ) { bInCache = bNew; } void SetInCache( bool bNew ) { m_bInCache = bNew; }
void SetInSwFntCache( bool bNew ) { bInSwFntCache = bNew; } void SetInSwFntCache( bool bNew ) { m_bInSwFntCache = bNew; }
void SetInDocDTOR() { bInDocDTOR = true; } void SetInDocDTOR() { m_bInDocDTOR = true; }
bool IsModifyLocked() const { return bModifyLocked; } bool IsModifyLocked() const { return m_bModifyLocked; }
bool IsInDocDTOR() const { return bInDocDTOR; } bool IsInDocDTOR() const { return m_bInDocDTOR; }
bool IsInCache() const { return bInCache; } bool IsInCache() const { return m_bInCache; }
bool IsInSwFntCache() const { return bInSwFntCache; } bool IsInSwFntCache() const { return m_bInSwFntCache; }
void CheckCaching( const sal_uInt16 nWhich ); void CheckCaching( const sal_uInt16 nWhich );
bool IsLastDepend() { return pRoot && pRoot->IsLast(); } bool IsLastDepend() { return m_pWriterListeners && m_pWriterListeners->IsLast(); }
}; };
// SwDepend // SwDepend
...@@ -265,13 +265,13 @@ namespace sw ...@@ -265,13 +265,13 @@ namespace sw
{ {
MoveTo(our_pClientIters); MoveTo(our_pClientIters);
our_pClientIters = this; our_pClientIters = this;
m_pCurrent = m_pPosition = const_cast<WriterListener*>(m_rRoot.pRoot); m_pCurrent = m_pPosition = const_cast<WriterListener*>(m_rRoot.m_pWriterListeners);
} }
WriterListener* GetLeftOfPos() { return m_pPosition->m_pLeft; } WriterListener* GetLeftOfPos() { return m_pPosition->m_pLeft; }
WriterListener* GetRightOfPos() { return m_pPosition->m_pRight; } WriterListener* GetRightOfPos() { return m_pPosition->m_pRight; }
WriterListener* GoStart() WriterListener* GoStart()
{ {
if((m_pPosition = const_cast<WriterListener*>(m_rRoot.pRoot))) if((m_pPosition = const_cast<WriterListener*>(m_rRoot.m_pWriterListeners)))
while( m_pPosition->m_pLeft ) while( m_pPosition->m_pLeft )
m_pPosition = m_pPosition->m_pLeft; m_pPosition = m_pPosition->m_pLeft;
return m_pCurrent = m_pPosition; return m_pCurrent = m_pPosition;
...@@ -309,7 +309,7 @@ public: ...@@ -309,7 +309,7 @@ public:
TElementType* Last() TElementType* Last()
{ {
if(!m_pPosition) if(!m_pPosition)
m_pPosition = const_cast<sw::WriterListener*>(m_rRoot.pRoot); m_pPosition = const_cast<sw::WriterListener*>(m_rRoot.m_pWriterListeners);
if(!m_pPosition) if(!m_pPosition)
return static_cast<TElementType*>(Sync()); return static_cast<TElementType*>(Sync());
while(GetRightOfPos()) while(GetRightOfPos())
...@@ -346,7 +346,7 @@ public: ...@@ -346,7 +346,7 @@ public:
SwClient* Last() SwClient* Last()
{ {
if(!m_pPosition) if(!m_pPosition)
m_pPosition = const_cast<sw::WriterListener*>(m_rRoot.pRoot); m_pPosition = const_cast<sw::WriterListener*>(m_rRoot.m_pWriterListeners);
if(!m_pPosition) if(!m_pPosition)
return m_pCurrent = nullptr; return m_pCurrent = nullptr;
while(GetRightOfPos()) while(GetRightOfPos())
......
...@@ -66,7 +66,7 @@ SwModify::~SwModify() ...@@ -66,7 +66,7 @@ SwModify::~SwModify()
if ( IsInSwFntCache() ) if ( IsInSwFntCache() )
pSwFontCache->Delete( this ); pSwFontCache->Delete( this );
if( pRoot ) if( m_pWriterListeners )
{ {
// there are depending objects // there are depending objects
if( IsInDocDTOR() ) if( IsInDocDTOR() )
...@@ -86,8 +86,8 @@ SwModify::~SwModify() ...@@ -86,8 +86,8 @@ SwModify::~SwModify()
// remove all clients that have not done themselves // remove all clients that have not done themselves
// mba: possibly a hotfix for forgotten base class calls?! // mba: possibly a hotfix for forgotten base class calls?!
while( pRoot ) while( m_pWriterListeners )
static_cast<SwClient*>(pRoot)->CheckRegistration( &aDyObject, &aDyObject ); static_cast<SwClient*>(m_pWriterListeners)->CheckRegistration( &aDyObject, &aDyObject );
} }
} }
} }
...@@ -101,7 +101,7 @@ void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* p ...@@ -101,7 +101,7 @@ void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* p
CheckCaching( nWhich ); CheckCaching( nWhich );
} }
if ( !pRoot || IsModifyLocked() ) if ( !m_pWriterListeners || IsModifyLocked() )
return; return;
LockModify(); LockModify();
...@@ -132,7 +132,7 @@ void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* p ...@@ -132,7 +132,7 @@ void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* p
bool SwModify::GetInfo( SfxPoolItem& rInfo ) const bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
{ {
if(!pRoot) if(!m_pWriterListeners)
return true; return true;
SwIterator<SwClient,SwModify> aIter(*this); SwIterator<SwClient,SwModify> aIter(*this);
for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next()) for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next())
...@@ -152,7 +152,7 @@ void SwModify::Add( SwClient* pDepend ) ...@@ -152,7 +152,7 @@ void SwModify::Add( SwClient* pDepend )
{ {
for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer()) for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer())
{ {
OSL_ENSURE( &rIter.m_rRoot != pRoot, "Client added to active ClientIter" ); OSL_ENSURE( &rIter.m_rRoot != m_pWriterListeners, "Client added to active ClientIter" );
} }
} }
#endif #endif
...@@ -160,19 +160,19 @@ void SwModify::Add( SwClient* pDepend ) ...@@ -160,19 +160,19 @@ void SwModify::Add( SwClient* pDepend )
if( pDepend->pRegisteredIn != nullptr ) if( pDepend->pRegisteredIn != nullptr )
pDepend->pRegisteredIn->Remove( pDepend ); pDepend->pRegisteredIn->Remove( pDepend );
if( !pRoot ) if( !m_pWriterListeners )
{ {
// first client added // first client added
pRoot = pDepend; m_pWriterListeners = pDepend;
pRoot->m_pLeft = nullptr; m_pWriterListeners->m_pLeft = nullptr;
pRoot->m_pRight = nullptr; m_pWriterListeners->m_pRight = nullptr;
} }
else else
{ {
// append client // append client
pDepend->m_pRight = pRoot->m_pRight; pDepend->m_pRight = m_pWriterListeners->m_pRight;
pRoot->m_pRight = pDepend; m_pWriterListeners->m_pRight = pDepend;
pDepend->m_pLeft = pRoot; pDepend->m_pLeft = m_pWriterListeners;
if( pDepend->m_pRight ) if( pDepend->m_pRight )
pDepend->m_pRight->m_pLeft = pDepend; pDepend->m_pRight->m_pLeft = pDepend;
} }
...@@ -184,7 +184,7 @@ void SwModify::Add( SwClient* pDepend ) ...@@ -184,7 +184,7 @@ void SwModify::Add( SwClient* pDepend )
SwClient* SwModify::Remove( SwClient* pDepend ) SwClient* SwModify::Remove( SwClient* pDepend )
{ {
if ( bInDocDTOR ) if ( m_bInDocDTOR )
return nullptr; return nullptr;
if( pDepend->pRegisteredIn == this ) if( pDepend->pRegisteredIn == this )
...@@ -193,8 +193,8 @@ SwClient* SwModify::Remove( SwClient* pDepend ) ...@@ -193,8 +193,8 @@ SwClient* SwModify::Remove( SwClient* pDepend )
// remove it from my list // remove it from my list
::sw::WriterListener* pR = pDepend->m_pRight; ::sw::WriterListener* pR = pDepend->m_pRight;
::sw::WriterListener* pL = pDepend->m_pLeft; ::sw::WriterListener* pL = pDepend->m_pLeft;
if( pRoot == pDepend ) if( m_pWriterListeners == pDepend )
pRoot = pL ? pL : pR; m_pWriterListeners = pL ? pL : pR;
if( pL ) if( pL )
pL->m_pRight = pR; pL->m_pRight = pR;
......
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