diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-13 12:59:46 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-14 02:23:42 +0100 |
commit | e07c6a6fea726904b5669baa50fc8ea45b4328f8 (patch) | |
tree | a16491ed450d5ddbc6386f0518f4773d546a84ea | |
parent | c2655a58527ec6b63af7c1191535d06ff71cee0c (diff) |
fix naming conventions while at it
Change-Id: I2d2daa78869764ebf236444187d4dcdc508208be
-rw-r--r-- | sw/inc/calbck.hxx | 90 | ||||
-rw-r--r-- | sw/source/core/attr/calbck.cxx | 14 |
2 files changed, 52 insertions, 52 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index c0b3ea210b26..421f61b6f430 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -208,108 +208,108 @@ class SwClientIter : public sw::Ring<SwClientIter> friend SwClient* SwModify::Remove(SwClient *); ///< for pointer adjustments friend void SwModify::Add(SwClient *pDepend); ///< for pointer adjustments - const SwModify& rRoot; + const SwModify& m_rRoot; // the current object in an iteration - SwClient* pAct; + SwClient* m_pCurrent; // in case the current object is already removed, the next object in the list // is marked down to become the current object in the next step // this is necessary because iteration requires access to members of the current object - SwClient* pDelNext; + SwClient* m_pPosition; // iterator can be limited to return only SwClient objects of a certain type - TypeId aSrchId; + TypeId m_aSearchType; - static SwClientIter* pClientIters; + static SW_DLLPUBLIC SwClientIter* our_pClientIters; public: SwClientIter( const SwModify& rModify ) - : rRoot(rModify) - , aSrchId(nullptr) + : m_rRoot(rModify) + , m_aSearchType(nullptr) { - MoveTo(pClientIters); - pClientIters = this; - pAct = pDelNext = const_cast<SwClient*>(rRoot.GetDepends()); + MoveTo(our_pClientIters); + our_pClientIters = this; + m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); } ~SwClientIter() { - assert(pClientIters); - if(pClientIters == this) - pClientIters = unique() ? nullptr : GetNextInRing(); + assert(our_pClientIters); + if(our_pClientIters == this) + our_pClientIters = unique() ? nullptr : GetNextInRing(); MoveTo(nullptr); } - const SwModify& GetModify() const { return rRoot; } + const SwModify& GetModify() const { return m_rRoot; } SwClient* operator++() { - if( pDelNext == pAct ) - pDelNext = static_cast<SwClient*>(pDelNext->m_pRight); - return pAct = pDelNext; + if( m_pPosition == m_pCurrent ) + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight); + return m_pCurrent = m_pPosition; } SwClient* GoStart() { - if((pDelNext = const_cast<SwClient*>(rRoot.GetDepends()))) - while( pDelNext->m_pLeft ) - pDelNext = static_cast<SwClient*>(pDelNext->m_pLeft); - return pAct = pDelNext; + if((m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()))) + while( m_pPosition->m_pLeft ) + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); + return m_pCurrent = m_pPosition; } SwClient* GoEnd() { - if(!pDelNext) - pDelNext = const_cast<SwClient*>(rRoot.GetDepends()); - if(pDelNext) - while( pDelNext->m_pRight ) - pDelNext = static_cast<SwClient*>(pDelNext->m_pRight); - return pAct = pDelNext; + if(!m_pPosition) + m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); + if(m_pPosition) + while( m_pPosition->m_pRight ) + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight); + return m_pCurrent = m_pPosition; } // returns the current SwClient object; // in case this was already removed, the object marked down to become // the next current one is returned SwClient* operator()() const - { return pDelNext == pAct ? pAct : pDelNext; } + { return m_pPosition == m_pCurrent ? m_pCurrent : m_pPosition; } // return "true" if an object was removed from a client chain in iteration // adding objects to a client chain in iteration is forbidden // SwModify::Add() asserts this - bool IsChanged() const { return pDelNext != pAct; } + bool IsChanged() const { return m_pPosition != m_pCurrent; } SwClient* First( TypeId nType ) { - aSrchId = nType; + m_aSearchType = nType; GoStart(); - if(!pDelNext) + if(!m_pPosition) return nullptr; - pAct = nullptr; + m_pCurrent = nullptr; return Next(); } SwClient* Last( TypeId nType ) { - aSrchId = nType; + m_aSearchType = nType; GoEnd(); - if(!pDelNext) + if(!m_pPosition) return nullptr; - if( pDelNext->IsA( aSrchId ) ) - return pDelNext; + if( m_pPosition->IsA( m_aSearchType ) ) + return m_pPosition; return Previous(); } SwClient* Next() { - if( pDelNext == pAct ) - pDelNext = static_cast<SwClient*>(pDelNext->m_pRight); - while(pDelNext && !pDelNext->IsA( aSrchId ) ) - pDelNext = static_cast<SwClient*>(pDelNext->m_pRight); - return pAct = pDelNext; + if( m_pPosition == m_pCurrent ) + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight); + while(m_pPosition && !m_pPosition->IsA( m_aSearchType ) ) + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pRight); + return m_pCurrent = m_pPosition; } SwClient* Previous() { - pDelNext = static_cast<SwClient*>(pDelNext->m_pLeft); - while(pDelNext && !pDelNext->IsA( aSrchId ) ) - pDelNext = static_cast<SwClient*>(pDelNext->m_pLeft); - return pAct = pDelNext; + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); + while(m_pPosition && !m_pPosition->IsA( m_aSearchType ) ) + m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); + return m_pCurrent = m_pPosition; } }; diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index bb0a8dc9afde..58fe03ee30f3 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -205,9 +205,9 @@ void SwModify::Add( SwClient* pDepend ) if(pDepend->pRegisteredIn != this ) { #if OSL_DEBUG_LEVEL > 0 - if(SwClientIter::pClientIters) + if(SwClientIter::our_pClientIters) { - for(auto& rIter : SwClientIter::pClientIters->GetRingContainer()) + for(auto& rIter : SwClientIter::our_pClientIters->GetRingContainer()) OSL_ENSURE( &rIter.GetModify() != pRoot, "Client added to active ClientIter" ); } #endif @@ -257,15 +257,15 @@ SwClient* SwModify::Remove( SwClient* pDepend ) pR->m_pLeft = pL; // update ClientIters - if(SwClientIter::pClientIters) + if(SwClientIter::our_pClientIters) { - for(auto& rIter : SwClientIter::pClientIters->GetRingContainer()) + for(auto& rIter : SwClientIter::our_pClientIters->GetRingContainer()) { - if( rIter.pAct == pDepend || rIter.pDelNext == pDepend ) + if( rIter.m_pCurrent == pDepend || rIter.m_pPosition == pDepend ) { // if object being removed is the current or next object in an // iterator, advance this iterator - rIter.pDelNext = static_cast<SwClient*>(pR); + rIter.m_pPosition = static_cast<SwClient*>(pR); } } } @@ -361,5 +361,5 @@ bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const return pToTell ? pToTell->GetInfo( rInfo ) : true; } -SwClientIter* SwClientIter::pClientIters = nullptr; +SwClientIter* SwClientIter::our_pClientIters = nullptr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |