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

more privacy tweaks

Change-Id: Id0d81d2216692f9b596493b5a424fea656295b71
üst 3170b41d
...@@ -247,13 +247,18 @@ namespace sw ...@@ -247,13 +247,18 @@ namespace sw
{ {
class ClientIteratorBase SAL_FINAL : public sw::Ring< ::sw::ClientIteratorBase > 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 template<typename E, typename S> friend class ::SwIterator; ///< for typed interation
const SwModify& m_rRoot; const SwModify& m_rRoot;
// the current object in an iteration // the current object in an iteration
SwClient* m_pCurrent; 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 ) ClientIteratorBase( const SwModify& rModify )
: m_rRoot(rModify) : m_rRoot(rModify)
...@@ -262,10 +267,6 @@ namespace sw ...@@ -262,10 +267,6 @@ namespace sw
our_pClientIters = this; our_pClientIters = this;
m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends()); 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* GetLeftOfPos() { return static_cast<SwClient*>(m_pPosition->m_pLeft); }
SwClient* GetRighOfPos() { return static_cast<SwClient*>(m_pPosition->m_pRight); } SwClient* GetRighOfPos() { return static_cast<SwClient*>(m_pPosition->m_pRight); }
SwClient* GoStart() SwClient* GoStart()
...@@ -275,11 +276,6 @@ namespace sw ...@@ -275,11 +276,6 @@ namespace sw
m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft); m_pPosition = static_cast<SwClient*>(m_pPosition->m_pLeft);
return m_pCurrent = m_pPosition; return m_pCurrent = m_pPosition;
} }
const SwModify& GetModify() const { return m_rRoot; }
static SW_DLLPUBLIC ClientIteratorBase* our_pClientIters;
public:
~ClientIteratorBase() SAL_OVERRIDE ~ClientIteratorBase() SAL_OVERRIDE
{ {
assert(our_pClientIters); assert(our_pClientIters);
......
...@@ -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.GetModify() != pRoot, "Client added to active ClientIter" ); OSL_ENSURE( &rIter.m_rRoot != pRoot, "Client added to active ClientIter" );
} }
} }
#endif #endif
......
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