From 9631f96acae6bd179d40ee343ce986296f490741 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 6 Jun 2012 12:41:41 +0200 Subject: Do not copy etc. singular iterator values. This also reverts previous attempts at fixing this, commits 33839f90e6f8275a584b483827585a6da05aab75 "ucb: try to fix weird STL assertion on tinderbox" and 6506af86b5e20a860c8d2d1dd578a22914df5f53 "ucb: second try to fix weird STL assertion on tinderbox." Change-Id: I89d0eb87fbd164c0a4cf24d60f225767cb2bfc1a --- ucb/source/inc/regexpmap.hxx | 2 ++ ucb/source/inc/regexpmap.tpt | 59 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 53 insertions(+), 8 deletions(-) (limited to 'ucb/source/inc') diff --git a/ucb/source/inc/regexpmap.hxx b/ucb/source/inc/regexpmap.hxx index e02363362a60..717a077a9e0f 100644 --- a/ucb/source/inc/regexpmap.hxx +++ b/ucb/source/inc/regexpmap.hxx @@ -101,6 +101,8 @@ class RegexpMapIter: public RegexpMapConstIter< Val > friend class RegexpMap< Val >; // to access ctor public: + RegexpMapIter() {} + RegexpMapIter & operator ++(); RegexpMapIter operator ++(int); diff --git a/ucb/source/inc/regexpmap.tpt b/ucb/source/inc/regexpmap.tpt index 64abc37bf8fd..b4e274ae94ed 100644 --- a/ucb/source/inc/regexpmap.tpt +++ b/ucb/source/inc/regexpmap.tpt @@ -74,11 +74,19 @@ public: typedef RegexpMapImpl< Val > MapImpl; typedef typename List< Val >::iterator ListIterator; + // Solaris needs these for the ctor... + + inline RegexpMapIterImpl(); + inline RegexpMapIterImpl(MapImpl * pTheMap, int nTheList, ListIterator aTheIndex); RegexpMapIterImpl(RegexpMapImpl< Val > * pTheMap, bool bBegin); + RegexpMapIterImpl(RegexpMapIterImpl const & rOther); + + RegexpMapIterImpl & operator =(RegexpMapIterImpl const & rOther); + bool operator ==(RegexpMapIterImpl const & rOther) const; RegexpMapImpl< Val > const * getMap() const { return m_pMap; } @@ -92,8 +100,6 @@ public: RegexpMapEntry< Val > & get(); private: - RegexpMapIterImpl(); // not implemented - mutable RegexpMapEntry< Val > m_aEntry; typename List< Val >::iterator m_aIndex; RegexpMapImpl< Val > * m_pMap; @@ -105,6 +111,14 @@ private: } +template< typename Val > +inline RegexpMapIterImpl< Val >::RegexpMapIterImpl(): + m_aEntry(rtl::OUString(), 0), + m_pMap(0), + m_nList(-1), + m_bEntrySet(false) +{} + template< typename Val > inline RegexpMapIterImpl< Val >::RegexpMapIterImpl(MapImpl * pTheMap, int nTheList, @@ -134,11 +148,10 @@ void RegexpMapIterImpl< Val >::setEntry() const //============================================================================ template< typename Val > RegexpMapIterImpl< Val >::RegexpMapIterImpl(RegexpMapImpl< Val > * pTheMap, - bool bBegin) - : m_aEntry(rtl::OUString(), 0) - , m_aIndex(pTheMap->m_aList[Regexp::KIND_DOMAIN].end()) - , m_pMap(pTheMap) - , m_bEntrySet(false) + bool bBegin): + m_aEntry(rtl::OUString(), 0), + m_pMap(pTheMap), + m_bEntrySet(false) { if (bBegin) { @@ -149,9 +162,39 @@ RegexpMapIterImpl< Val >::RegexpMapIterImpl(RegexpMapImpl< Val > * pTheMap, else { m_nList = Regexp::KIND_DOMAIN; + m_aIndex = m_pMap->m_aList[Regexp::KIND_DOMAIN].end(); } } +//============================================================================ +template< typename Val > +RegexpMapIterImpl< Val >::RegexpMapIterImpl(RegexpMapIterImpl const & rOther): + m_aEntry(rOther.m_aEntry), m_pMap(rOther.m_pMap), m_nList(rOther.m_nList), + m_bEntrySet(rOther.m_bEntrySet) +{ + if (m_nList != -1) + m_aIndex = rOther.m_aIndex; +} + +//============================================================================ +template< typename Val > +RegexpMapIterImpl< Val > & RegexpMapIterImpl< Val >::operator =( + RegexpMapIterImpl const & rOther) +{ + if (this != &rOther) + { + m_aEntry = rOther.m_aEntry; + m_pMap = rOther.m_pMap; + m_nList = rOther.m_nList; + m_bEntrySet = rOther.m_bEntrySet; + if (m_nList == -1) + m_aIndex = typename List< Val >::iterator(); + else + m_aIndex = rOther.m_aIndex; + } + return *this; +} + //============================================================================ template< typename Val > bool RegexpMapIterImpl< Val >::operator ==(RegexpMapIterImpl const & rOther) @@ -159,7 +202,7 @@ bool RegexpMapIterImpl< Val >::operator ==(RegexpMapIterImpl const & rOther) { return m_pMap == rOther.m_pMap && m_nList == rOther.m_nList - && m_aIndex == rOther.m_aIndex; + && (m_nList == -1 || m_aIndex == rOther.m_aIndex); } //============================================================================ -- cgit