diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-03 22:56:55 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-04 12:01:13 +0100 |
commit | f46327e6c99e5230907debf660337a47d4fa7caf (patch) | |
tree | 22c30c3fe9ed9ba63b45355bb3bb4e4366ba0464 /chart2 | |
parent | 25ad18c1e136a03b0d04a1aefbde43a2290460dc (diff) |
chart2: replace boost::ptr_map with std::map
Change-Id: Id647a5b681e10defd944ccb2ec8509689df704af
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/inc/VDataSeries.hxx | 4 | ||||
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 17 |
2 files changed, 10 insertions, 11 deletions
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx index 05e6e16b95cc..38da4c45e0d8 100644 --- a/chart2/source/view/inc/VDataSeries.hxx +++ b/chart2/source/view/inc/VDataSeries.hxx @@ -35,8 +35,8 @@ #include <memory> #include <vector> +#include <map> #include <boost/noncopyable.hpp> -#include <boost/ptr_container/ptr_map.hpp> namespace chart { @@ -206,7 +206,7 @@ private: //member VDataSequence* m_pValueSequenceForDataLabelNumberFormatDetection; - boost::ptr_map<OUString, VDataSequence> maPropertyMap; + std::map<OUString, VDataSequence> m_PropertyMap; mutable double m_fXMeanValue; mutable double m_fYMeanValue; diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 60b641278d46..b0cf9ff5ead2 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -229,9 +229,9 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries ) m_aValues_Bubble_Size.init( xDataSequence ); else { - VDataSequence* pSequence = new VDataSequence(); - pSequence->init( xDataSequence ); - maPropertyMap.insert(aRole, pSequence); + VDataSequence aSequence; + aSequence.init(xDataSequence); + m_PropertyMap.insert(std::make_pair(aRole, aSequence)); } } catch( const uno::Exception& e ) @@ -1087,7 +1087,7 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const pNew->m_aValues_Y_First = m_aValues_Y_First; pNew->m_aValues_Y_Last = m_aValues_Y_Last; pNew->m_aValues_Bubble_Size = m_aValues_Bubble_Size; - pNew->maPropertyMap = maPropertyMap; + pNew->m_PropertyMap = m_PropertyMap; pNew->m_nPointCount = m_nPointCount; @@ -1096,16 +1096,15 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropName ) const { - boost::ptr_map<OUString, VDataSequence>::const_iterator itr = - maPropertyMap.find(rPropName); - if(itr == maPropertyMap.end()) + auto const itr = m_PropertyMap.find(rPropName); + if (itr == m_PropertyMap.end()) { double fNan; ::rtl::math::setNan( &fNan ); return fNan; } - const VDataSequence* pData = itr->second; + const VDataSequence* pData = &itr->second; double fValue = pData->getValue(nIndex); if(mpOldSeries && mpOldSeries->hasPropertyMapping(rPropName)) { @@ -1129,7 +1128,7 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN bool VDataSeries::hasPropertyMapping(const OUString& rPropName ) const { - return maPropertyMap.find(rPropName) != maPropertyMap.end(); + return m_PropertyMap.find(rPropName) != m_PropertyMap.end(); } } //namespace chart |