summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-06-06 12:41:41 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-07 14:32:30 +0200
commit20b7bf008b1dcdf402de81c19e3cbd1284048cb2 (patch)
tree0b120f5a45fcf4f3e830452b4e2588f4ae2ffcf6 /ucb
parentf28e7ef1877de10467e574edac0dd679f42ab31c (diff)
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 (cherry picked from commit 9631f96acae6bd179d40ee343ce986296f490741)
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/core/ucb.cxx4
-rw-r--r--ucb/source/inc/regexpmap.hxx2
-rw-r--r--ucb/source/inc/regexpmap.tpt59
3 files changed, 55 insertions, 10 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index fec9972a2e2d..64a412b778b7 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -399,7 +399,7 @@ UniversalContentBroker::registerContentProvider(
{
osl::MutexGuard aGuard(m_aMutex);
- ProviderMap_Impl::iterator aIt(m_aProviders.end());
+ ProviderMap_Impl::iterator aIt;
try
{
aIt = m_aProviders.find(Scheme);
@@ -445,7 +445,7 @@ void SAL_CALL UniversalContentBroker::deregisterContentProvider(
{
osl::MutexGuard aGuard(m_aMutex);
- ProviderMap_Impl::iterator aMapIt(m_aProviders.end());
+ ProviderMap_Impl::iterator aMapIt;
try
{
aMapIt = m_aProviders.find(Scheme);
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;
@@ -106,6 +112,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,
ListIterator aTheIndex):
@@ -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,17 +162,47 @@ 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)
const
{
return m_pMap == rOther.m_pMap
&& m_nList == rOther.m_nList
- && m_aIndex == rOther.m_aIndex;
+ && (m_nList == -1 || m_aIndex == rOther.m_aIndex);
}
//============================================================================