Bug 132332 - Numerical cells with hyperlinks are sorted non-numerically
Summary: Numerical cells with hyperlinks are sorted non-numerically
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.7.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sorting
  Show dependency treegraph
 
Reported: 2020-04-22 20:48 UTC by Nadie Nada Nunca
Modified: 2024-03-11 09:35 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot showing the bug (18.22 KB, image/jpeg)
2020-04-22 20:49 UTC, Nadie Nada Nunca
Details
Sample file (24.70 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-23 02:12 UTC, Nadie Nada Nunca
Details
A simplified sample file (8.84 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-24 02:21 UTC, Ming Hua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nadie Nada Nunca 2020-04-22 20:48:29 UTC
Description:
I have a spreadsheet with a column with numerical data (years). Some of the cells have the number hyperlinked to a webpage. When I sort by that column, hyperlinked years are sorted below all non-hyperlinked years. The natural thing to do would be to ignore the fact that there's a hyperlink there and sort the cell by its visible contents (the number).


Steps to Reproduce:
1. Create a cell with a "years" column and fill it with years.
2. Select some of the years and insert hyperlinks to various webpages.
3. Sort the spreadsheet by the "years" column.

Actual Results:
Rows with hyperlinks are put below the rows without hyperlinks.

Expected Results:
The column should be sorted by year.


Reproducible: Always


User Profile Reset: No



Additional Info:
Screenshot attached.
Comment 1 Nadie Nada Nunca 2020-04-22 20:49:29 UTC
Created attachment 159824 [details]
Screenshot showing the bug
Comment 2 m_a_riosv 2020-04-22 20:51:49 UTC
Please attach a sample file.
Comment 3 Nadie Nada Nunca 2020-04-23 02:12:16 UTC
Created attachment 159830 [details]
Sample file

Sort by "Año" (year), or by any other column and then "Año".
Comment 4 QA Administrators 2020-04-23 03:38:53 UTC Comment hidden (obsolete)
Comment 5 m_a_riosv 2020-04-23 20:20:31 UTC
Sorting by column B, works for me.
Version: 6.4.3.2 (x64)
Build ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8
CPU threads: 4; OS: Windows 10.0 Build 19613; UI render: GL; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US Calc: CL
Comment 6 Nadie Nada Nunca 2020-04-23 22:01:12 UTC
Just a note: this should be absolutely independent from locale. Whether a number is linked to anything else has no bearing on how it should be sorted.
Comment 7 Ming Hua 2020-04-23 22:26:45 UTC
I can reproduce with 6.2.8 on Windows 10:
Version: 6.2.8.2 (x64)
Build ID: f82ddfca21ebc1e222a662a32b25c0c9d20169ee
CPU threads: 2; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: zh-CN (zh_CN); UI-Language: en-US
Calc: threaded

Steps:
1. Open the attached sample file;
2. Click in cell B1;
3. Data > Sort Descending (Sort Ascending works too, but it doesn't change the current order of the cells);
4. Observe that row 2 to 72 are sorted, but all years with links are considered larger than the ones without links.

Row 73 and higher are not sorted probably because B73 is empty and therefore seen as the border of the auto-recognized region for sorting.
Comment 8 Ming Hua 2020-04-24 02:21:47 UTC
Created attachment 159881 [details]
A simplified sample file

This is another sample file, simplified to 2 columns and 4 rows.

Both cell A3 ("2") and B4 ("cake") contain hyperlinks.  Sorting by text (column B) gives expected result, while sorting by number (column A) puts the row with "2" after 1, 3, and 4.
Comment 9 Ming Hua 2020-04-24 21:27:38 UTC
Also reproduced with 5.2.7, the oldest version I have:
Version: 5.2.7.2 (x64)
Build ID: 2b7f1e640c46ceb28adf43ee075a6e8b8439ed10
CPU Threads: 2; OS Version: Windows 6.19; UI Render: default; 
Locale: zh-CN (zh_CN); Calc: group
Comment 10 Andreas Heinisch 2021-02-17 08:40:44 UTC
The problem is that LO treats cells with hyperlinks as strings and sorts numbers before strings. Maybe we can check, if the value in the cell can be treated as numeric value and sorted accordingly, but I can't tell if additional problems arise by doing this. Are there some cases where this should not be done?
Comment 11 Nadie Nada Nunca 2022-03-11 12:03:25 UTC
... well, it's been a year, and the bug persists in LO 7.2. Is there any hope for this to be fixed?
Comment 12 QA Administrators 2024-03-11 03:12:28 UTC Comment hidden (obsolete)
Comment 13 Nadie Nada Nunca 2024-03-11 09:35:46 UTC
Still present. 

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: es-AR (es_AR); UI: en-US
Calc: CL threaded