diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-01-25 16:56:43 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-25 23:40:44 +0000 |
commit | ca1994d4877810215c90acc42ce160695e32d032 (patch) | |
tree | 5d70b7d27fee8397072a7243836ea76d2b99123b /chart2/source | |
parent | a2ebd811d4049e2ed03c677cbc7d0e2c8515b797 (diff) |
bnc#590020: Sort data points stably.
std::sort is unstable sort, which is not what we want. Use std::stable_sort
to sort data points by X values. If we use unstable sort, it may mess up
the order of the sequence when two data points contain identical X values.
Change-Id: I6453a986185b326dc680fbcec6227ea332235b22
Reviewed-on: https://gerrit.libreoffice.org/1871
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index f0e267ca8834..fcd69ff775f2 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -304,7 +304,7 @@ void VDataSeries::doSortByXValues() } //do sort - std::sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() ); + std::stable_sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() ); //fill the sorted points back to the members m_aValues_X.Doubles.realloc( m_nPointCount ); |