diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-11-06 23:44:31 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-09 12:04:11 +0100 |
commit | 3b49489707447cca30c7bcb54e9bfc6ffc9ab2e1 (patch) | |
tree | aac5428f6958de9a3375e5e9d776aae25f349985 | |
parent | 5fd6aa03c8b3964ba7ccc1cbe4d4421a500fce72 (diff) |
sc: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I1929d105d46c373c40d1f53e7d933435118737d4
-rw-r--r-- | sc/inc/formulagroup.hxx | 5 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 11 | ||||
-rw-r--r-- | sc/source/core/tool/formulagroup.cxx | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx index 15c2a60ce6c5..2e18cced06ec 100644 --- a/sc/inc/formulagroup.hxx +++ b/sc/inc/formulagroup.hxx @@ -28,7 +28,6 @@ #include <unordered_map> #include <vector> #include <boost/noncopyable.hpp> -#include <boost/ptr_container/ptr_vector.hpp> class ScDocument; class ScTokenArray; @@ -59,7 +58,7 @@ struct FormulaGroupContext : boost::noncopyable typedef std::vector<double, DoubleAllocType> NumArrayType; typedef std::vector<rtl_uString*> StrArrayType; typedef std::vector<std::unique_ptr<NumArrayType>> NumArrayStoreType; - typedef boost::ptr_vector<StrArrayType> StrArrayStoreType; + typedef std::vector<std::unique_ptr<StrArrayType>> StrArrayStoreType; struct ColKey { @@ -89,7 +88,7 @@ struct FormulaGroupContext : boost::noncopyable typedef std::unordered_map<ColKey, ColArray, ColKey::Hash> ColArraysType; NumArrayStoreType m_NumArrays; /// manage life cycle of numeric arrays. - StrArrayStoreType maStrArrays; /// manage life cycle of string arrays. + StrArrayStoreType m_StrArrays; /// manage life cycle of string arrays. ColArraysType maColArrays; /// keep track of longest array for each column. diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index e6983d989433..cb1f14590a01 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -2504,9 +2504,9 @@ copyFirstFormulaBlock( { if (!pStrArray) { - rCxt.maStrArrays.push_back( - new sc::FormulaGroupContext::StrArrayType(nArrayLen, NULL)); - pStrArray = &rCxt.maStrArrays.back(); + rCxt.m_StrArrays.push_back( + o3tl::make_unique<sc::FormulaGroupContext::StrArrayType>(nArrayLen, nullptr)); + pStrArray = rCxt.m_StrArrays.back().get(); } (*pStrArray)[nPos] = aRes.maString.getDataIgnoreCase(); @@ -2602,8 +2602,9 @@ formula::VectorRefArray ScColumn::FetchVectorRefArray( SCROW nRow1, SCROW nRow2 case sc::element_type_string: case sc::element_type_edittext: { - rCxt.maStrArrays.push_back(new sc::FormulaGroupContext::StrArrayType(nRow2+1, NULL)); - sc::FormulaGroupContext::StrArrayType& rArray = rCxt.maStrArrays.back(); + rCxt.m_StrArrays.push_back( + o3tl::make_unique<sc::FormulaGroupContext::StrArrayType>(nRow2+1, nullptr)); + sc::FormulaGroupContext::StrArrayType& rArray = *rCxt.m_StrArrays.back(); pColArray = rCxt.setCachedColArray(nTab, nCol, NULL, &rArray); if (!pColArray) // Failed to insert a new cached column array. diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx index 835ed2ae8c12..8506fb7c033a 100644 --- a/sc/source/core/tool/formulagroup.cxx +++ b/sc/source/core/tool/formulagroup.cxx @@ -112,9 +112,9 @@ void FormulaGroupContext::ensureStrArray( ColArray& rColArray, size_t nArrayLen if (rColArray.mpStrArray) return; - maStrArrays.push_back( - new sc::FormulaGroupContext::StrArrayType(nArrayLen, NULL)); - rColArray.mpStrArray = &maStrArrays.back(); + m_StrArrays.push_back( + o3tl::make_unique<sc::FormulaGroupContext::StrArrayType>(nArrayLen, nullptr)); + rColArray.mpStrArray = m_StrArrays.back().get(); } void FormulaGroupContext::ensureNumArray( ColArray& rColArray, size_t nArrayLen ) |