[Libreoffice-commits] .: Branch 'libreoffice-4-0' - chart2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 25 15:41:04 PST 2013


 chart2/source/view/main/VDataSeries.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ca1994d4877810215c90acc42ce160695e32d032
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Jan 25 16:56:43 2013 -0500

    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 at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

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 @@ 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 );


More information about the Libreoffice-commits mailing list