From 25ad18c1e136a03b0d04a1aefbde43a2290460dc Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 3 Dec 2015 22:48:05 +0100 Subject: chart2: replace boost::ptr_map with std::map Change-Id: I0b80042bdab33b52b339267292249add6f70ac3c --- chart2/source/view/charttypes/VSeriesPlotter.cxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'chart2') diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 4ed9bdcd5a28..d0f230fc181b 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -84,7 +85,6 @@ #include #include -#include namespace chart { @@ -1684,9 +1684,9 @@ class PerXMinMaxCalculator { typedef std::pair MinMaxType; typedef std::map SeriesMinMaxType; - typedef boost::ptr_map GroupMinMaxType; + typedef std::map> GroupMinMaxType; typedef std::unordered_map TotalStoreType; - GroupMinMaxType maSeriesGroup; + GroupMinMaxType m_SeriesGroup; size_t mnCurSeries; public: @@ -1751,12 +1751,11 @@ private: void getTotalStore(TotalStoreType& rStore) const { TotalStoreType aStore; - GroupMinMaxType::const_iterator it = maSeriesGroup.begin(), itEnd = maSeriesGroup.end(); - for (; it != itEnd; ++it) + for (auto const& it : m_SeriesGroup) { - double fX = it->first; + double fX = it.first; - const SeriesMinMaxType& rSeries = *it->second; + const SeriesMinMaxType& rSeries = *it.second; SeriesMinMaxType::const_iterator itSeries = rSeries.begin(), itSeriesEnd = rSeries.end(); for (; itSeries != itSeriesEnd; ++itSeries) { @@ -1781,11 +1780,11 @@ private: SeriesMinMaxType* getByXValue(double fX) { - GroupMinMaxType::iterator it = maSeriesGroup.find(fX); - if (it == maSeriesGroup.end()) + GroupMinMaxType::iterator it = m_SeriesGroup.find(fX); + if (it == m_SeriesGroup.end()) { std::pair r = - maSeriesGroup.insert(fX, new SeriesMinMaxType); + m_SeriesGroup.insert(std::make_pair(fX, o3tl::make_unique())); if (!r.second) // insertion failed. @@ -1794,7 +1793,7 @@ private: it = r.first; } - return it->second; + return it->second.get(); } }; -- cgit