Kaydet (Commit) f46327e6 authored tarafından Michael Stahl's avatar Michael Stahl

chart2: replace boost::ptr_map with std::map

Change-Id: Id647a5b681e10defd944ccb2ec8509689df704af
üst 25ad18c1
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <map>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_map.hpp>
namespace chart namespace chart
{ {
...@@ -206,7 +206,7 @@ private: //member ...@@ -206,7 +206,7 @@ private: //member
VDataSequence* m_pValueSequenceForDataLabelNumberFormatDetection; VDataSequence* m_pValueSequenceForDataLabelNumberFormatDetection;
boost::ptr_map<OUString, VDataSequence> maPropertyMap; std::map<OUString, VDataSequence> m_PropertyMap;
mutable double m_fXMeanValue; mutable double m_fXMeanValue;
mutable double m_fYMeanValue; mutable double m_fYMeanValue;
......
...@@ -229,9 +229,9 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries ) ...@@ -229,9 +229,9 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
m_aValues_Bubble_Size.init( xDataSequence ); m_aValues_Bubble_Size.init( xDataSequence );
else else
{ {
VDataSequence* pSequence = new VDataSequence(); VDataSequence aSequence;
pSequence->init( xDataSequence ); aSequence.init(xDataSequence);
maPropertyMap.insert(aRole, pSequence); m_PropertyMap.insert(std::make_pair(aRole, aSequence));
} }
} }
catch( const uno::Exception& e ) catch( const uno::Exception& e )
...@@ -1087,7 +1087,7 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const ...@@ -1087,7 +1087,7 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const
pNew->m_aValues_Y_First = m_aValues_Y_First; pNew->m_aValues_Y_First = m_aValues_Y_First;
pNew->m_aValues_Y_Last = m_aValues_Y_Last; pNew->m_aValues_Y_Last = m_aValues_Y_Last;
pNew->m_aValues_Bubble_Size = m_aValues_Bubble_Size; pNew->m_aValues_Bubble_Size = m_aValues_Bubble_Size;
pNew->maPropertyMap = maPropertyMap; pNew->m_PropertyMap = m_PropertyMap;
pNew->m_nPointCount = m_nPointCount; pNew->m_nPointCount = m_nPointCount;
...@@ -1096,16 +1096,15 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const ...@@ -1096,16 +1096,15 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const
double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropName ) const double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropName ) const
{ {
boost::ptr_map<OUString, VDataSequence>::const_iterator itr = auto const itr = m_PropertyMap.find(rPropName);
maPropertyMap.find(rPropName); if (itr == m_PropertyMap.end())
if(itr == maPropertyMap.end())
{ {
double fNan; double fNan;
::rtl::math::setNan( &fNan ); ::rtl::math::setNan( &fNan );
return fNan; return fNan;
} }
const VDataSequence* pData = itr->second; const VDataSequence* pData = &itr->second;
double fValue = pData->getValue(nIndex); double fValue = pData->getValue(nIndex);
if(mpOldSeries && mpOldSeries->hasPropertyMapping(rPropName)) if(mpOldSeries && mpOldSeries->hasPropertyMapping(rPropName))
{ {
...@@ -1129,7 +1128,7 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN ...@@ -1129,7 +1128,7 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN
bool VDataSeries::hasPropertyMapping(const OUString& rPropName ) const bool VDataSeries::hasPropertyMapping(const OUString& rPropName ) const
{ {
return maPropertyMap.find(rPropName) != maPropertyMap.end(); return m_PropertyMap.find(rPropName) != m_PropertyMap.end();
} }
} //namespace chart } //namespace chart
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment