summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-13 09:10:38 +0200
committerNoel Grandin <noel@peralex.com>2015-11-13 10:54:19 +0200
commite5e2f119eff6f57ad7abc70efd4986f8f8b3fc00 (patch)
treef03a992eea3fd3d986db4a59d70816a3e96e0af4 /sc
parentf3ba19b37f212a5839a91223f77d501d79e2c4b5 (diff)
sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I85eb08c85700a2a5e0bd0edaf46ca99fded9dbb5
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/dpcache.hxx3
-rw-r--r--sc/source/core/data/dpcache.cxx18
-rw-r--r--sc/source/core/data/dpsave.cxx1
3 files changed, 11 insertions, 11 deletions
diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 7226be9fd6cd..9422b76faccc 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -25,7 +25,6 @@
#include <tools/date.hxx>
#include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <mdds/flat_segment_tree.hpp>
#include <memory>
@@ -111,7 +110,7 @@ private:
mutable ScDPObjectSet maRefObjects;
typedef std::vector< std::unique_ptr<Field> > FieldsType;
- typedef boost::ptr_vector<GroupItems> GroupFieldsType;
+ typedef std::vector< std::unique_ptr<GroupItems> > GroupFieldsType;
FieldsType maFields;
GroupFieldsType maGroupFields;
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index cf4a1a44a708..01e33268fe9b 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -675,7 +675,7 @@ const ScDPCache::GroupItems* ScDPCache::GetGroupItems(long nDim) const
nDim -= nSourceCount;
if (nDim < static_cast<long>(maGroupFields.size()))
- return &maGroupFields[nDim];
+ return maGroupFields[nDim].get();
return nullptr;
}
@@ -823,7 +823,7 @@ const ScDPItemData* ScDPCache::GetItemDataById(long nDim, SCROW nId) const
if (nDimPos >= maGroupFields.size())
return nullptr;
- const ScDPItemDataVec& rGI = maGroupFields[nDimPos].maItems;
+ const ScDPItemDataVec& rGI = maGroupFields[nDimPos]->maItems;
if (nItemId >= rGI.size())
return nullptr;
@@ -968,7 +968,7 @@ SCROW ScDPCache::GetIdByItemData(long nDim, const ScDPItemData& rItem) const
nDim -= mnColumnCount;
if (static_cast<size_t>(nDim) < maGroupFields.size())
{
- const ScDPItemDataVec& rGI = maGroupFields[nDim].maItems;
+ const ScDPItemDataVec& rGI = maGroupFields[nDim]->maItems;
for (size_t i = 0, n = rGI.size(); i < n; ++i)
{
if (rGI[i] == rItem)
@@ -1029,7 +1029,7 @@ OUString ScDPCache::GetFormattedString(long nDim, const ScDPItemData& rItem) con
long ScDPCache::AppendGroupField()
{
- maGroupFields.push_back(new GroupItems);
+ maGroupFields.push_back(o3tl::make_unique<GroupItems>());
return static_cast<long>(maFields.size() + maGroupFields.size() - 1);
}
@@ -1048,7 +1048,7 @@ void ScDPCache::ResetGroupItems(long nDim, const ScDPNumGroupInfo& rNumInfo, sal
nDim -= nSourceCount;
if (nDim < static_cast<long>(maGroupFields.size()))
{
- GroupItems& rGI = maGroupFields[nDim];
+ GroupItems& rGI = *maGroupFields[nDim].get();
rGI.maItems.clear();
rGI.maInfo = rNumInfo;
rGI.mnGroupType = nGroupType;
@@ -1072,7 +1072,7 @@ SCROW ScDPCache::SetGroupItem(long nDim, const ScDPItemData& rData)
nDim -= nSourceCount;
if (nDim < static_cast<long>(maGroupFields.size()))
{
- ScDPItemDataVec& rItems = maGroupFields.at(nDim).maItems;
+ ScDPItemDataVec& rItems = maGroupFields.at(nDim)->maItems;
rItems.push_back(rData);
return rItems.size()-1;
}
@@ -1102,7 +1102,7 @@ void ScDPCache::GetGroupDimMemberIds(long nDim, std::vector<SCROW>& rIds) const
nDim -= nSourceCount;
if (nDim < static_cast<long>(maGroupFields.size()))
{
- const ScDPItemDataVec& rGI = maGroupFields.at(nDim).maItems;
+ const ScDPItemDataVec& rGI = maGroupFields.at(nDim)->maItems;
for (size_t i = 0, n = rGI.size(); i < n; ++i)
rIds.push_back(static_cast<SCROW>(i));
}
@@ -1142,7 +1142,7 @@ const ScDPNumGroupInfo* ScDPCache::GetNumGroupInfo(long nDim) const
nDim -= nSourceCount;
if (nDim < static_cast<long>(maGroupFields.size()))
- return &maGroupFields.at(nDim).maInfo;
+ return &maGroupFields.at(nDim)->maInfo;
return nullptr;
}
@@ -1163,7 +1163,7 @@ sal_Int32 ScDPCache::GetGroupType(long nDim) const
nDim -= nSourceCount;
if (nDim < static_cast<long>(maGroupFields.size()))
- return maGroupFields.at(nDim).mnGroupType;
+ return maGroupFields.at(nDim)->mnGroupType;
return 0;
}
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 4e01d4f5b4ba..935aa9cad71f 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -51,6 +51,7 @@
#include <unordered_map>
#include <unordered_set>
+#include <algorithm>
using namespace com::sun::star;
using namespace com::sun::star::sheet;