diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-18 17:20:56 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-18 17:21:29 +0100 |
commit | def6b1dd14b7d7dbf776e3de9e2f2d5a0cd1fc2c (patch) | |
tree | 305804c2937bc4a6d58db09ab06611edb7a97a7b /sc | |
parent | 91f571a2d6b0db016342fa2f2e5b7b83a23ae873 (diff) |
sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Ia9d061d9f5fb07e07fd6253a6493a4e9b1f9c975
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/dpobject.hxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 27 | ||||
-rw-r--r-- | sc/source/filter/xml/pivotsource.cxx | 2 |
3 files changed, 17 insertions, 18 deletions
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 0af7348eff14..610cf8e89a70 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -35,8 +35,6 @@ #include <vector> #include <map> -#include <boost/ptr_container/ptr_map.hpp> - namespace com { namespace sun { namespace star { namespace container { @@ -337,8 +335,8 @@ public: class DBCaches { friend class ScDPCollection; - typedef ::boost::ptr_map<DBType, ScDPCache, DBType::less> CachesType; - CachesType maCaches; + typedef ::std::map<DBType, std::unique_ptr<ScDPCache>, DBType::less> CachesType; + CachesType m_Caches; ScDocument* mpDoc; public: DBCaches(ScDocument* pDoc); diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index f6fee9f8d2b4..59dcd61639df 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -68,7 +68,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <comphelper/types.hxx> -#include <o3tl/ptr_container.hxx> #include <sal/macros.h> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -3104,8 +3103,8 @@ ScDPCollection::DBCaches::DBCaches(ScDocument* pDoc) : mpDoc(pDoc) {} bool ScDPCollection::DBCaches::hasCache(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) const { DBType aType(nSdbType, rDBName, rCommand); - CachesType::const_iterator itr = maCaches.find(aType); - return itr != maCaches.end(); + CachesType::const_iterator const itr = m_Caches.find(aType); + return itr != m_Caches.end(); } const ScDPCache* ScDPCollection::DBCaches::getCache( @@ -3113,10 +3112,10 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( const ScDPDimensionSaveData* pDimData) { DBType aType(nSdbType, rDBName, rCommand); - CachesType::const_iterator itr = maCaches.find(aType); - if (itr != maCaches.end()) + CachesType::const_iterator const itr = m_Caches.find(aType); + if (itr != m_Caches.end()) // already cached. - return itr->second; + return itr->second.get(); uno::Reference<sdbc::XRowSet> xRowSet = createRowSet(nSdbType, rDBName, rCommand); if (!xRowSet.is()) @@ -3140,7 +3139,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( ::comphelper::disposeComponent(xRowSet); const ScDPCache* p = pCache.get(); - o3tl::ptr_container::insert(maCaches, aType, std::move(pCache)); + m_Caches.insert(std::make_pair(aType, std::move(pCache))); return p; } @@ -3148,8 +3147,8 @@ ScDPCache* ScDPCollection::DBCaches::getExistingCache( sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) { DBType aType(nSdbType, rDBName, rCommand); - CachesType::iterator itr = maCaches.find(aType); - return itr != maCaches.end() ? itr->second : nullptr; + CachesType::iterator const itr = m_Caches.find(aType); + return itr != m_Caches.end() ? itr->second.get() : nullptr; } uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet( @@ -3215,8 +3214,8 @@ void ScDPCollection::DBCaches::updateCache( std::set<ScDPObject*>& rRefs) { DBType aType(nSdbType, rDBName, rCommand); - CachesType::iterator it = maCaches.find(aType); - if (it == maCaches.end()) + CachesType::iterator const it = m_Caches.find(aType); + if (it == m_Caches.end()) { // not cached. rRefs.clear(); @@ -3255,12 +3254,12 @@ void ScDPCollection::DBCaches::updateCache( bool ScDPCollection::DBCaches::remove(const ScDPCache* p) { - CachesType::iterator it = maCaches.begin(), itEnd = maCaches.end(); + CachesType::iterator it = m_Caches.begin(), itEnd = m_Caches.end(); for (; it != itEnd; ++it) { - if (it->second == p) + if (it->second.get() == p) { - maCaches.erase(it); + m_Caches.erase(it); return true; } } diff --git a/sc/source/filter/xml/pivotsource.cxx b/sc/source/filter/xml/pivotsource.cxx index 43b5a4d0faeb..633b8c5b1abe 100644 --- a/sc/source/filter/xml/pivotsource.cxx +++ b/sc/source/filter/xml/pivotsource.cxx @@ -11,6 +11,8 @@ #include <dpsave.hxx> +#include <algorithm> + namespace sc { PivotTableSources::SelectedPages::SelectedPages( ScDPObject* pObj, const SelectedPagesType& rSelected ) : |