Bug 84009 - EDITING: wrong sorting when copying results to another sheet
Summary: EDITING: wrong sorting when copying results to another sheet
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.1.1 rc
Hardware: Other All
: medium normal
Assignee: Kohei Yoshida
URL:
Whiteboard: target:4.4.0 target:4.2.7 target:4.3.3
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-09-17 16:47 UTC by spYre
Modified: 2014-09-25 14:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description spYre 2014-09-17 16:47:14 UTC
Steps to reproduce:
1. open new spreadsheet and add a second sheet
2. in Sheet1, insert values 1 to 10 in range A1:A10
3. menu Data->Sort..., key "Column A", order "Descending"
4. select tab Options -> Copy sort results to..., then enter "Sheet2.A1" as destination
5. validate

Expected behavior:
Values should appear sorted in Sheet2 and unmodified on Sheet1.

What happens:
Values are copied unsorted on Sheet2 while sorted on Sheet1.
It seems that LibO sorts the good destination cell range, but with reference to the source sheet : try copying to Sheet2.A2 instead of Sheet2.A1...

Sorting is done correctly in LibO 4.2.
Tested on Windows 7, Windows XP and LinuxMint.

I mark this bug as critical, sorting being a basic feature of spreadsheets !

Thanks in advance for having a look.
Comment 1 spYre 2014-09-17 18:10:14 UTC
The bug can be reproduced with the 4.3.2.1 RC (Build ID: f9b3ad49d92181b0a1fe7e76f785a2c2cd0847d3).
Comment 2 Cor Nouws 2014-09-17 19:05:36 UTC
hi spYre,

Can confirm this on daily (master 4.4) > Set to new.
Thanks for reporting!

I reset the importance for the moment.

Cheers,
Cor
Comment 3 Cor Nouws 2014-09-17 19:19:21 UTC
Was OK in 4.3.0.4, broken in 4.3.1.1

Sorting is basic feature... yes, but copying results to another position... no. Also I guess that the failure will be visible immediately.


Note for the developer:
  When Sheet1.A1 is empty
and 
 Results are copied to Sheet2.A1 
the range on Sheet1 is mangled too:

- - - - - - - -  - -  -
Sheet1       Sheet2
1		4
1		3
3		1
4		6
5		76
6		5
34		34
76		1
		23
23		

- - - - - - - -  - -  -
Comment 4 Kohei Yoshida 2014-09-19 13:08:07 UTC
Easy 5-minute fix.  Already fixed locally.  Will push shortly.
Comment 5 Commit Notification 2014-09-19 13:15:42 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5fd4679e7b92f344ea867e0dca1fc4c9363ae2cd

fdo#84009: Be sure to update the sheet index when moving the sort range.



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.
Comment 6 Commit Notification 2014-09-19 13:16:10 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8af25862f1782ff1fb0f66415e3a2d624f61d737

fdo#84009: Adjust the test case to catch this.



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.
Comment 7 Kohei Yoshida 2014-09-19 13:18:53 UTC
Fixed on master, and backports to 4.2 and 4.3 on the way.
Comment 8 Commit Notification 2014-09-23 14:17:51 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8066367bbe0adebae515862ebd260560657ace02&h=libreoffice-4-2

fdo#84009: Be sure to update the sheet index when moving the sort range.


It will be available in LibreOffice 4.2.7.

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.
Comment 9 Commit Notification 2014-09-25 14:34:04 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=14907346d792f2f93a00083bbab5086cf56ddb24&h=libreoffice-4-3

fdo#84009: Be sure to update the sheet index when moving the sort range.


It will be available in LibreOffice 4.3.3.

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.