[Libreoffice-commits] .: ucb/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Jun 6 03:46:28 PDT 2012


 ucb/source/core/ucb.cxx      |    4 +-
 ucb/source/inc/regexpmap.hxx |    2 +
 ucb/source/inc/regexpmap.tpt |   59 +++++++++++++++++++++++++++++++++++++------
 3 files changed, 55 insertions(+), 10 deletions(-)

New commits:
commit 9631f96acae6bd179d40ee343ce986296f490741
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 6 12:41:41 2012 +0200

    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

diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index fec9972..64a412b 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 e023633..717a077 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 64abc37..b4e274a 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);
 }
 
 //============================================================================


More information about the Libreoffice-commits mailing list