Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1871

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/71/1871/1

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
---
M chart2/source/view/main/VDataSeries.cxx
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index f0e267c..fcd69ff 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -304,7 +304,7 @@
         }
 
         //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 );

-- 
To view, visit https://gerrit.libreoffice.org/1871
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6453a986185b326dc680fbcec6227ea332235b22
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Kohei Yoshida <kohei.yoshida@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.