Issue 121681 - Wrong sorting of values in Calc
Summary: Wrong sorting of values in Calc
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: 3.4.1
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-28 01:50 UTC by Pedro Giffuni
Modified: 2022-10-28 12:54 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 3.4.1
Developer Difficulty: Easy


Attachments
File showing the sort error (19.22 KB, application/octet-stream)
2013-01-28 01:50 UTC, Pedro Giffuni
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Pedro Giffuni 2013-01-28 01:50:52 UTC
Created attachment 80178 [details]
File showing the sort error

A SUSE linux user reported a problem in OOo 3.2:

"In the attachment you can see a XY-diagram sorted by x-values which shows a
wrong stair. The whole diagram should look like stairs but oo.org uses the
y-value of the two x-value = 6 points wrong.
The two points with the x-value = 6 have the y-values 0.6333 and 0.7666. If you
click on these two points you can see that the point with y=0.7666 is UNDER the
point with y=0.6333"

I am attaching the document for reference.

The fix is very easy and non-copyrightable:

In file chart2/source/view/main/VDataSeries.cxx

Change the occurance of std::sort (line 312) for std_stable::sort.
Comment 1 Pedro Giffuni 2013-01-28 01:53:47 UTC
(In reply to comment #0)

...
> 
> The fix is very easy and non-copyrightable:
> 
> In file chart2/source/view/main/VDataSeries.cxx
> 
> Change the occurance of std::sort (line 312) for std_stable::sort.

I meant std::stable_sort .
Comment 2 Oliver Brinzing 2013-01-28 05:36:57 UTC
.
Comment 3 Pedro Giffuni 2013-01-31 21:20:29 UTC
(In reply to comment #1)
> (In reply to comment #0)
> 
> ...
> > 
> > The fix is very easy and non-copyrightable:
> > 
> > In file chart2/source/view/main/VDataSeries.cxx
> > 
> > Change the occurance of std::sort (line 312) for std_stable::sort.
> 
> I meant std::stable_sort .

I forgot to mention the fix is based on the comments by Kohei Yoshida.
Comment 4 SVN Robot 2013-01-31 21:23:00 UTC
"pfg" committed SVN revision 1441196 into trunk:
i121681 - Wrong sorting of values in Calc
Comment 5 Pedro Giffuni 2013-02-01 21:37:59 UTC
Seems to work.
Comment 6 Pedro Giffuni 2013-02-02 18:27:08 UTC
For reference hrishit submitted the same fix here:

https://issues.apache.org/ooo/attachment.cgi?id=80197&action=diff#main/chart2/source/view/main/VDataSeries.cxx_sec1