summaryrefslogtreecommitdiffstats
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-09-02 19:52:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-03 10:16:51 +0200
commita9a648fbf47f94151de0d525e432b45919ba7504 (patch)
treeae867e54131632a424012438648f02c97daaafeb /chart2/source
parentofz: MemorySanitizer: use-of-uninitialized-value (diff)
downloadcore-a9a648fbf47f94151de0d525e432b45919ba7504.tar.gz
core-a9a648fbf47f94151de0d525e432b45919ba7504.zip
no need to allocate SeriesMinMaxType separately
Change-Id: I7121375a6bf731f8d30f69aa8c90b102675a8bb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121531 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index b5bfc8d871b0..dd3fec5bd61a 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1970,7 +1970,7 @@ class PerXMinMaxCalculator
{
typedef std::pair<double, double> MinMaxType;
typedef std::map<size_t, MinMaxType> SeriesMinMaxType;
- typedef std::map<double, std::unique_ptr<SeriesMinMaxType>> GroupMinMaxType;
+ typedef std::map<double, SeriesMinMaxType> GroupMinMaxType;
typedef std::unordered_map<double, MinMaxType> TotalStoreType;
GroupMinMaxType m_SeriesGroup;
size_t mnCurSeries;
@@ -2042,7 +2042,7 @@ private:
{
double fX = it.first;
- const SeriesMinMaxType& rSeries = *it.second;
+ const SeriesMinMaxType& rSeries = it.second;
for (auto const& series : rSeries)
{
double fYMin = series.second.first, fYMax = series.second.second;
@@ -2069,7 +2069,7 @@ private:
if (it == m_SeriesGroup.end())
{
std::pair<GroupMinMaxType::iterator,bool> r =
- m_SeriesGroup.insert(std::make_pair(fX, std::make_unique<SeriesMinMaxType>()));
+ m_SeriesGroup.insert(std::make_pair(fX, SeriesMinMaxType{}));
if (!r.second)
// insertion failed.
@@ -2078,7 +2078,7 @@ private:
it = r.first;
}
- return it->second.get();
+ return &it->second;
}
};