summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-12-09 14:00:31 +0100
committerMichael Stahl <mstahl@redhat.com>2015-12-15 17:44:34 +0100
commit7086ed59512f359bc62963202a08d41e2e5ceccb (patch)
tree532e74d4b14ada25522d2995a14f30bb182213d7 /sc
parent14a0115b9580d541971440c085220328c5aed92e (diff)
sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I800f8d4facaa6dc8eb04b2544ce0e9035af66442
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/callform.hxx8
-rw-r--r--sc/source/core/data/funcdesc.cxx2
-rw-r--r--sc/source/core/tool/callform.cxx24
3 files changed, 22 insertions, 12 deletions
diff --git a/sc/inc/callform.hxx b/sc/inc/callform.hxx
index a883ec518f01..584c1d17634b 100644
--- a/sc/inc/callform.hxx
+++ b/sc/inc/callform.hxx
@@ -22,7 +22,8 @@
#include <rtl/ustring.hxx>
-#include <boost/ptr_container/ptr_map.hpp>
+#include <memory>
+#include <map>
#define MAXFUNCPARAM 16
#define MAXARRSIZE 0xfffe
@@ -86,8 +87,9 @@ public:
class LegacyFuncCollection
{
- typedef boost::ptr_map<OUString, LegacyFuncData> MapType;
- MapType maData;
+ typedef std::map<OUString, std::unique_ptr<LegacyFuncData>> MapType;
+ MapType m_Data;
+
public:
typedef MapType::const_iterator const_iterator;
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index ff72cdc6a80b..b9c6e30b6f0a 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -451,7 +451,7 @@ ScFunctionList::ScFunctionList() :
LegacyFuncCollection::const_iterator it = rLegacyFuncColl.begin(), itEnd = rLegacyFuncColl.end();
for (; it != itEnd; ++it)
{
- const LegacyFuncData* pLegacyFuncData = it->second;
+ const LegacyFuncData *const pLegacyFuncData = it->second.get();
pDesc = new ScFuncDesc;
sal_uInt16 nArgs = pLegacyFuncData->GetParamCount() - 1;
pLegacyFuncData->getParamDesc( aArgName, aArgDesc, 0 );
diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx
index 3334715acf97..af3cc33e5f0a 100644
--- a/sc/source/core/tool/callform.cxx
+++ b/sc/source/core/tool/callform.cxx
@@ -25,6 +25,8 @@
#include <osl/module.hxx>
#include <osl/file.hxx>
#include <unotools/transliterationwrapper.hxx>
+#include <o3tl/make_unique.hxx>
+#include <boost/ptr_container/ptr_map.hpp>
#include <memory>
#include "callform.hxx"
@@ -398,34 +400,40 @@ bool LegacyFuncData::getParamDesc( OUString& aName, OUString& aDesc, sal_uInt16
}
LegacyFuncCollection::LegacyFuncCollection() {}
-LegacyFuncCollection::LegacyFuncCollection(const LegacyFuncCollection& r) : maData(r.maData) {}
+LegacyFuncCollection::LegacyFuncCollection(const LegacyFuncCollection& r)
+{
+ for (auto const& it : r.m_Data)
+ {
+ m_Data.insert(std::make_pair(it.first, o3tl::make_unique<LegacyFuncData>(*it.second)));
+ }
+}
const LegacyFuncData* LegacyFuncCollection::findByName(const OUString& rName) const
{
- MapType::const_iterator it = maData.find(rName);
- return it == maData.end() ? nullptr : it->second;
+ MapType::const_iterator it = m_Data.find(rName);
+ return it == m_Data.end() ? nullptr : it->second.get();
}
LegacyFuncData* LegacyFuncCollection::findByName(const OUString& rName)
{
- MapType::iterator it = maData.find(rName);
- return it == maData.end() ? nullptr : it->second;
+ MapType::iterator it = m_Data.find(rName);
+ return it == m_Data.end() ? nullptr : it->second.get();
}
void LegacyFuncCollection::insert(LegacyFuncData* pNew)
{
OUString aName = pNew->GetInternalName();
- maData.insert(aName, pNew);
+ m_Data.insert(std::make_pair(aName, std::unique_ptr<LegacyFuncData>(pNew)));
}
LegacyFuncCollection::const_iterator LegacyFuncCollection::begin() const
{
- return maData.begin();
+ return m_Data.begin();
}
LegacyFuncCollection::const_iterator LegacyFuncCollection::end() const
{
- return maData.end();
+ return m_Data.end();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */