diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-03 22:48:05 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-04 12:01:13 +0100 |
commit | 25ad18c1e136a03b0d04a1aefbde43a2290460dc (patch) | |
tree | 62421985fa1159cfeb2d66827296726ce5204ed8 /chart2 | |
parent | 51a5dfd783bfc1efc52a791aab4114039581252f (diff) |
chart2: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I0b80042bdab33b52b339267292249add6f70ac3c
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/VSeriesPlotter.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
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 <com/sun/star/chart2/RelativePosition.hpp> #include <editeng/unoprnms.hxx> #include <tools/color.hxx> +#include <o3tl/make_unique.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/math.hxx> #include <basegfx/vector/b2dvector.hxx> @@ -84,7 +85,6 @@ #include <map> #include <unordered_map> -#include <boost/ptr_container/ptr_map.hpp> namespace chart { @@ -1684,9 +1684,9 @@ class PerXMinMaxCalculator { typedef std::pair<double, double> MinMaxType; typedef std::map<size_t, MinMaxType> SeriesMinMaxType; - typedef boost::ptr_map<double, SeriesMinMaxType> GroupMinMaxType; + typedef std::map<double, std::unique_ptr<SeriesMinMaxType>> GroupMinMaxType; typedef std::unordered_map<double, MinMaxType> 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<GroupMinMaxType::iterator,bool> r = - maSeriesGroup.insert(fX, new SeriesMinMaxType); + m_SeriesGroup.insert(std::make_pair(fX, o3tl::make_unique<SeriesMinMaxType>())); if (!r.second) // insertion failed. @@ -1794,7 +1793,7 @@ private: it = r.first; } - return it->second; + return it->second.get(); } }; |