Created attachment 106129 [details] Calc document to reproduce this bug in Calc 4.3.0.4 Re-executing the same sort command (with the same settings) many times, produces as a result many different ordered set of data. Steps to reproduce: 1) Open the attached calc document in Calc. 2) Select range from F1 to AY373 3) Open the "Sort" dialog with Data--> Sort... 4) In the "Option" tab check "Left to right (sort columns) 5) In the "Sort criteria" tab set: - Sort key 1: Row 7 Descending - Sort key 2: Row 8 Ascending 6) Press OK. You can see a wrong ordered set of data. 7) Open again the Sort dialog and Press OK again. You can see another wrong ordered set of data. 8) Any time you press OK, you get a different wrong ordered set of data.
Reproducible with LO 4.3.1.2 portable under Win7 x86 Still don't have a clue how to repro from scratch with a simpler case.
Created attachment 106653 [details] Simpler calc document to reproduce this bug
I added a simpler Calc document reproducing this bug, which is depending on the fact that sorting by colums causes the forulas in row 2 to become wrong. To reproduce: - Select range B1-F8 - Sort by column: row 2 descending, row 1 ascending. Result: the formulas in row2 don't change to reflect their new position.
Thanks Doriano...it's clearer now :D Simplified steps to repro from scratch: 1). Fill cells A1:C3 with following data: 1 1 2 3 1 1 =SUM(A1:A2) =SUM(B1:B2) =SUM(C1:C2) 2). Select cells A1:C3 > Data > Sort 3). Tab: Options > choose Direction 'Left to right (sort columns)' 4). Tab: Sort Criteria > Sort key 1 "Row 3" (default: Ascending) > OK Sort result: 3 4 2 -> incorrect Expected result: 2 3 4 *) Incorrect result also shown if we choose Descending on step 4). Reproduced with: LO 4.3.1.2, 4.2.6.3 portable under Win7 x86 Not reproduced with: LO 4.1.6.2 portable
That should be fixed in latest release. Not reproduced under Ubuntu 12.04 x86 with: - LO 4.3.2.2 - LO 4.2.7.0.0+ Time: 2014-09-11_14:25:14 @Doriano, please reopen and mark UNCONFIRMED if you can reproduce in the next release
In fact this bug report is a duplicate of bug 79441. Best regards. JBF *** This bug has been marked as a duplicate of bug 79441 ***
This is NOT a duplicate of 79441 which is about references to *other* sheets within the document. I couldn't reproduce in 4.3.3 either. This seems to have been fixed by one of the other various sorting bugfixes.
Steps to reproduce this bug on 4.3.3.2 on Win7: 1). Fill cells A1:C3 with following data: 1 1 2 3 1 1 =SUM(A1:A2) =SUM(B1:B2) =SUM(C1:C2) 2). Select the WHOLE COLUMNS A:C > Data > Sort 3). Tab: Options > choose Direction 'Left to right (sort columns)' 4). Tab: Sort Criteria > Sort key 1 "Row 3" (default: Ascending) > OK Sort result: 3 4 2 -> incorrect Expected result: 2 3 4 This bug doesn't show anymore if you select only the cells range A1:C3 while sorting.
Can reproduce with a whole column selection also in Linux 4.3.3.2, and it is reproducible in 4-3 (to-be 4.3.4) when selecting only A1:C3
(In reply to Eike Rathke from comment #9) > Can reproduce with a whole column selection also in Linux 4.3.3.2, and it is > reproducible in 4-3 (to-be 4.3.4) when selecting only A1:C3 For me it works in 4.3.4.0.0+ when selecting only A1:C3 if you set the hidden option UpdateReferenceOnSort to true (default value: false). Note: the step "select entire columns" was not in the initial description and comments before comments #8. So I guess it is a distinct issue. Tested on Version: 4.3.4.0.0+ Build ID: 9f89fbf3be626b13799b1b9c0fb8ca246148bcfb built at home under Ubuntu 14.10 x86-64 Best regards. JBF
Needs to be confirmed again by QA Team. Setting to UNCONFIRMED.
Thank you to everybody for your deep involvement trying to find a solution to this issue. Unfortunately I'm not a sw developer and I'm not able to find any hint where to set that "UpdateReferenceOnSort" to True. Any help is greatly appreciated. Even if this options seems to me an option like: "Do you want to use this bug? Yes/No"
(In reply to Doriano Cometto from comment #12) > Unfortunately I'm not a sw developer and I'm not able to find any hint where > to set that "UpdateReferenceOnSort" to True. Any help is greatly appreciated. You will have this option in next version 4.3.4. Best regards. JBF
I have this effect, too. My version of libreoffice is 4.2.7.2 on Ubuntu Linux. This effect occurs, when inserting the 98 row of data. The original file had 117 data sheets, most of then were filled by links to internet data (tables). I reduced the content as long as I could reproduce this error. The remaining data is a single table with 3 data rows.
Created attachment 109069 [details] Table to reproduce the sorting error
First I though that my file was corrupted. Now I assume, it is libreoffice calc, which is broken. The same effect occurs with old backups of my file. The sort order changes every time, the sort button is pressed. The more rows in the table, the more phantasy the sort algorithm gets.
Version: 4.2.6.3 Build-ID: 420m0(Build:3) on Ubuntu works well.
Created attachment 109119 [details] Attempted to sort by TotalCost3Nights and it sorts by PerNight v4.2.7.2 Build ID: 420m0(Build:2)
Sorry, forgot to confirm this bug report (see comment #3), I used it for the case "Ranking_Columns" in the summary spreadsheet for the metabug bug 85490, see attachment 109016 [details]. The issue here is that it works in versions 4.0 and 4.1 but not in 4.2 and in versions 4.3.4 and future 4.4.0 it works again but only with a config option incompatible with previous versions. So the regression has its cause in earlier versions of the branch 4.2, not in the change due to bug 81309, even if this change make sorting working again on this case. Best regards. JBF
I can NOT reproduce in any released version the problem reported in comment 14 to comment 17 with attachment 109069 [details]. Even if I could that would be a different problem as sorting with the button reorders by rows, whereas this bug here is about reordering by columns. I assume that other problem is specific to Ubuntu having applied a patch that landed on the 4-2 branch with http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-4-2&id=67f3ce3a9df2bc62db5602dd84975047c1137b92 I remember I've seen such a bug but I don't recall which. @Bjoern: Do you? Actually that was fixed on master with http://cgit.freedesktop.org/libreoffice/core/commit/?id=10fc138307afb4b39baddb0d56eb8e986e5d29ea and backported to 4-3 with https://gerrit.libreoffice.org/12113 pushed as http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-4-3&id=81e4dbe1adf196ee20f1a4bfbc50b54abfc79f4b See also bug 85215#c13 That change needs to be applied also to 4-2 and probably also for Ubuntu.
Darn, actually that was https://gerrit.libreoffice.org/12106 4-3 backport pushed as http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-4-3&id=81e4dbe1adf196ee20f1a4bfbc50b54abfc79f4b See https://bugs.freedesktop.org/show_bug.cgi?id=85215#c10
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=115a4b7ca36f65d93070d2e81048320d202e87a3 fdo#83765 do not update references in SortReorderByColumn() if disabled It will be available in 4.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Also attachment 109119 [details] comment 18 seems to be a victim of that other bug.
Pending review for 4-3 at https://gerrit.libreoffice.org/12986 for 4-2 at https://gerrit.libreoffice.org/12987
Pushed to 4-2 as http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-4-2&id=e44d09160038c7cf661e23885a0997d54ca01752
Pushed to 4-3 as https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=d1d41626387391d72c0e495a43b6190e6d0fec02