Issue 121681 - Wrong sorting of values in Calc
Wrong sorting of values in Calc
Status: RESOLVED FIXED
Product: Calc
Classification: Application
Component: code
3.4.1
All All
: P3 normal (vote)
: 4.0.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-28 01:50 UTC by Pedro Giffuni
Modified: 2013-02-02 18:27 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: 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 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