Bug 145889 - Autofilter result is wrong if the column contains the number "1000" and the text "'1000"
Summary: Autofilter result is wrong if the column contains the number "1000" and the t...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: AutoFilter
  Show dependency treegraph
 
Reported: 2021-11-25 14:33 UTC by Kevin Suo
Modified: 2024-03-02 11:04 UTC (History)
3 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 Kevin Suo 2021-11-25 14:33:17 UTC
Steps to Reproduce:

1. Type the following in cells A1, A2 and A3:

a
1000
'1000

i.e., the data label is "a", the first value is the number 1000, and the second value is the text 1000.

2. Set autofilter, click the dropdown, deselect the first item, OK.

--> The filter result is empty.

Expected: The filter result should either show the number 1000, or the text '1000.


Further Steps:

3. Based on step 2, now click the dropdown and select "All", OK.

--> Autofilter is still set, with empty result.

Expected: The autofilter should reset and all the records should show up.


One such real-world use case document is column B ("Allocation") in attachment 176404 [details] of bug 136838.


Version: 7.3.0.0.alpha1+ / LibreOffice Community
Build ID: a029e07ffbd6ea4a4a191188c5be2eca7e10066d
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Build Platform: Fedora34@X64, Branch:master, bibisect-linux-64-7.3-CN
Calc: threaded

Fedora 34 Wayland
Comment 1 Ming Hua 2021-11-25 15:35:48 UTC
Reproduced with 7.3/master daily build on Windows 10:
Version: 7.3.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 4be0ae19065b1b50870bc0b2a28189ad39c96a8a
CPU threads: 2; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded
Comment 2 Ming Hua 2021-11-25 16:01:36 UTC
The behavior in 7.1.7 is a bit different, but still buggy:

(In reply to Kevin Suo from comment #0)
> Steps to Reproduce:
> [...]
> 2. Set autofilter, click the dropdown, deselect the first item, OK.
> 
> --> The filter result is empty.
In 7.1.7 the result is also empty.

> [...]
> 3. Based on step 2, now click the dropdown and select "All", OK.
> 
> --> Autofilter is still set, with empty result.
In 7.1.7 clicking dropdown a second time and selecting "All" works and both A2 and A3 shows up.

Version: 7.1.7.2 (x64) / LibreOffice Community
Build ID: c6a4e3954236145e2acb0b65f68614365aeee33f
CPU threads: 2; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: zh-CN (zh_CN); UI: zh-CN
Calc: threaded

Not sure how to set the Version field based on this, leaving it alone.
Comment 3 m_a_riosv 2021-11-25 23:55:12 UTC
@Lubos have done some patches today like https://cgit.freedesktop.org/libreoffice/core/commit/?id=c41b0bf4c32e1934021d2d607f3f2fe7bc755cc8, maybe it's worth to retest in a couple of days.
Comment 4 Kevin Suo 2021-11-26 00:07:14 UTC
(In reply to m.a.riosv from comment #3)
Still broken as of 7b0aabe71d2455f6f643553a07f1056935cf190f which includes all the auto-filrer improvement patches these days, but this issue still exists.
Comment 5 Kevin Suo 2022-02-02 17:02:04 UTC
Change version to 7.1.7 per comment 2.
Comment 6 QA Administrators 2024-02-03 03:15:46 UTC Comment hidden (obsolete)
Comment 7 Kevin Suo 2024-02-06 01:29:09 UTC Comment hidden (obsolete)
Comment 8 Kevin Suo 2024-02-06 01:31:19 UTC
Bug is still in
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7a3e9c66baff8554d1267bc98c9c69e763bc8bdc
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Calc: threaded
Comment 9 Kevin Suo 2024-03-02 11:00:34 UTC
The relevant code may be in:
https://opengrok.libreoffice.org/xref/core/sc/source/core/tool/typedstrdata.cxx?r=6d0fddb6

ScTypedStrData::LessXXX()
Comment 10 Kevin Suo 2024-03-02 11:04:09 UTC
Balazs Varga: I think you may be interested in this one?