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

make SwClientIter construcatable only from SwIter

Change-Id: I6e203792187311f3d00fd074fd67cbae7680723e
üst 59665096
...@@ -245,7 +245,8 @@ protected: ...@@ -245,7 +245,8 @@ protected:
class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter>
{ {
friend SwClient* SwModify::Remove(SwClient*); friend SwModify;
//friend SwClient* SwModify::Remove(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;
...@@ -253,6 +254,13 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> ...@@ -253,6 +254,13 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter>
// the current object in an iteration // the current object in an iteration
SwClient* m_pCurrent; SwClient* m_pCurrent;
SwClientIter( const SwModify& rModify )
: m_rRoot(rModify)
{
MoveTo(our_pClientIters);
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 // 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 // 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 // this is necessary because iteration requires access to members of the current object
...@@ -271,13 +279,6 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter> ...@@ -271,13 +279,6 @@ class SwClientIter SAL_FINAL : public sw::Ring<SwClientIter>
static SW_DLLPUBLIC SwClientIter* our_pClientIters; static SW_DLLPUBLIC SwClientIter* our_pClientIters;
public: public:
SwClientIter( const SwModify& rModify )
: m_rRoot(rModify)
{
MoveTo(our_pClientIters);
our_pClientIters = this;
m_pCurrent = m_pPosition = const_cast<SwClient*>(m_rRoot.GetDepends());
}
~SwClientIter() SAL_OVERRIDE ~SwClientIter() SAL_OVERRIDE
{ {
assert(our_pClientIters); assert(our_pClientIters);
......
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