diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-18 16:23:19 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-03-19 23:41:09 +0100 |
commit | 181feb38d95e25980b96c2f6802cc906410abb13 (patch) | |
tree | 3fd201e8ac011ba7a2d710e876248fcec803b0e7 | |
parent | 3170b41ddcc69a2f65d8ae48352a183937badce9 (diff) |
more privacy tweaks
Change-Id: Id0d81d2216692f9b596493b5a424fea656295b71
-rw-r--r-- | sw/inc/calbck.hxx | 18 | ||||
-rw-r--r-- | sw/source/core/attr/calbck.cxx | 2 |
2 files changed, 8 insertions, 12 deletions
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index d3080c7e0757..0275c167af9d 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -247,13 +247,18 @@ namespace sw { class ClientIteratorBase SAL_FINAL : public sw::Ring< ::sw::ClientIteratorBase > { - friend SwModify; + friend SwClient* SwModify::Remove(SwClient*); + friend void SwModify::Add(SwClient*); template<typename E, typename S> friend class ::SwIterator; ///< for typed interation const SwModify& m_rRoot; - // the current object in an iteration 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* m_pPosition; + static SW_DLLPUBLIC ClientIteratorBase* our_pClientIters; ClientIteratorBase( const SwModify& rModify ) : m_rRoot(rModify) @@ -262,10 +267,6 @@ namespace sw our_pClientIters = this; m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); } - // 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* m_pPosition; SwClient* GetLeftOfPos() { return static_cast<SwClient*>(m_pPosition->m_pLeft); } SwClient* GetRighOfPos() { return static_cast<SwClient*>(m_pPosition->m_pRight); } SwClient* GoStart() @@ -275,11 +276,6 @@ namespace sw m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); return m_pCurrent = m_pPosition; } - const SwModify& GetModify() const { return m_rRoot; } - - static SW_DLLPUBLIC ClientIteratorBase* our_pClientIters; - - public: ~ClientIteratorBase() SAL_OVERRIDE { assert(our_pClientIters); diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 86f2d7459ec1..ee786939ea87 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -152,7 +152,7 @@ void SwModify::Add( SwClient* pDepend ) { for(auto& rIter : sw::ClientIteratorBase::our_pClientIters->GetRingContainer()) { - OSL_ENSURE( &rIter.GetModify() != pRoot, "Client added to active ClientIter" ); + OSL_ENSURE( &rIter.m_rRoot != pRoot, "Client added to active ClientIter" ); } } #endif |