Bug 141745 - Reordering columns alters sort settings
Summary: Reordering columns alters sort settings
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sorting
  Show dependency treegraph
 
Reported: 2021-04-18 13:31 UTC by Nadie Nada Nunca
Modified: 2022-12-20 12:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample spreadsheet showing the bug (13.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-05-03 12:07 UTC, Nadie Nada Nunca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nadie Nada Nunca 2021-04-18 13:31:26 UTC
Description:
If you have a spreadsheet that you frequently sort with headers in the first row, your sorting criteria is preserved every time you invoke Data | Sort. But if you reorder the columns by dragging them with the Alt key pressed, Calc will ignore that fact and still use the columns by their order in the spreadsheet. 

Example: you have a spreadsheet with columns ID (A), Description (B), Date (C), Cost (D), Manufacturer (E), and invoke Data | Sort to get them ordered first by Date, then by Manufacturer, and then by Cost. Every time you invoke Data | Sort, you'll have these columns preselected. 

But if you then reorder the columns, so that they become for example Manufacturer (A), Date (B), Cost (C), ID (D), and Description (E), the next time you invoke Data | Sort your preselected columns will be Cost, then Description, then ID. 

This is kiiind of technically correct but it's in no way what the user expects, so I consider it a bug.


Steps to Reproduce:
See description.

Actual Results:
See description.

Expected Results:
See description.


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no
Comment 1 Nadie Nada Nunca 2021-05-03 12:07:56 UTC
Created attachment 171604 [details]
Sample spreadsheet showing the bug

This has been marked as "unconfirmed" so I'm attaching a sample file to illustrate. 

Sort by the Date Column by using Data | Sort. Then, click on the Date column header (C) to highlight it, and drag it to the right of the Cost column while pressing the Alt key so that the two columns switch positions. 

Now invoke Data | Sort again. 

Calc will offer you to sort by Cost, which is now column C. 

I consider this a bug because if Calc is smart enough to recognize the column header, it should be smart enough to know that this column is not the same as before, and you STILL want to sort by date, not cost.
Comment 2 Nadie Nada Nunca 2022-03-11 12:07:40 UTC
Any news on this? Still happens in LibreOffice 7.2.
Comment 3 Heiko Tietze 2022-12-20 12:19:38 UTC
Reasonable enhancement request to also switch the sort criteria after exchanging columns. Should be the same for rows if the sorting has been done "left to right". To some extend I can follow the bug evaluation as the sort dialog falsely indicates the sorting.

(In reply to Nadie Nada Nunca from comment #2)
> Any news on this?

Sorry for the delay, QA tries the best to give at least feedback on tickets. You did everything to describe the problem as best as possible. Next is to find volunteers to work on the issue.