Bug 157476 - AutoFilter is filtering incorrectly when set to hide empty cells
Summary: AutoFilter is filtering incorrectly when set to hide empty cells
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, implementationError, regression
Depends on:
Blocks: AutoFilter
  Show dependency treegraph
 
Reported: 2023-09-27 13:39 UTC by slavaf2000
Modified: 2024-01-19 15:43 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
File demonstrating filtering issue (21.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-09-27 13:40 UTC, slavaf2000
Details

Note You need to log in before you can comment on or make changes to this bug.
Description slavaf2000 2023-09-27 13:39:13 UTC
Description:
When applying a filter to remove blanks, the filter also filters our other values erroneously

Steps to Reproduce:
1. Open attached spreadsheet, and click on the filter button in cell A1
2. Uncheck "Empty" and click ok
3. Click on the filter button in cell A1 again and scroll through the list of values. You will observe that some other values have been unchecked as well, and they are in fact filtered out, which can be confirmed by comparing the sum of all values before applying the filter, and after applying the filter.

Actual Results:
Other values have been filtered out as well, although only "empty" was unchecked when applying the filter

Expected Results:
Only empty cells would be filtered out and everything else will not be filtered out


Reproducible: Always


User Profile Reset: No

Additional Info:
"Allow use of OpenCL" in setting is unchecked (and therefore OpenCL is not used)
Comment 1 slavaf2000 2023-09-27 13:40:27 UTC
Created attachment 189848 [details]
File demonstrating filtering issue
Comment 2 ady 2023-09-28 01:02:03 UTC
In attachment 189848 [details], when unchecking "empty" from the filter, results with the following rows also hidden (not just the 3 empty rows):

value	row

	25
8.26	171
	201
8.26	213
0.65	261
	353

Repro in version LO 7.2 and newer, but not in older versions.

This seems some kind of mix between regression and implementation error, when the "not-empty" explicit filter option disappeared and the "empty" filter option remained as part of the list of check-boxed values.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 80a24870491385ba145757bf517c5f1cf7939017
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (es_AR); UI: en-US
Calc: CL threaded

I have not investigated the reason for this unexpected result.

Showing _all_ rows and clearing the format of the entire column containing the relevant values (column A); when filtering again by "not-empty" values will result in the correct expected result.

It sounds strange that some format of some cells/values would make the filter hide such cells when the applied filter is "not-empty"; the cell is not empty (whichever special format was applied to it).

Setting to NEW.
Comment 3 slavaf2000 2023-09-28 01:32:17 UTC
I also noticed a few anomalies about the values that were filtered out incorrectly:

In regards to value "0.65", it appears in the following rows with the following values:

row 272, value 0.649999999999999
row 293, value 0.649999999999999
row 323, value 0.649999999999999
row 379, value 0.649999999999999
row 98, value 0.65
row 261, value 0.650000000000002

Therefore there are 3 unique "variations" of this value. If you apply a filter to only show "0.65" (i.e. check this value 3 times in the filter list), all rows mentioned above except row 261 will be shown, which is an error. Row 261 should be shown as well.

In regards to value "8.26", it appears in the following rows with the following values:

row 71, value 8.25999999999999
row 171, value 8.26000000000002
row 213, value 8.26000000000002

Therefore, there are 2 unique "variations" of this value. If you apply a filter to only show "8.26" (i.e. check this value 2 times in the filter list), only row 71 is shown but not row 171 and not row 213, which is an error. These rows should be shown as well.
Comment 4 BogdanB 2023-09-28 05:18:57 UTC
The procedure is similar to https://bugs.documentfoundation.org/show_bug.cgi?id=150861 where we have to click on AutoFilter twice, and the result is incorrect.
Comment 5 BogdanB 2023-09-29 18:47:16 UTC
Balazs, could you please take a look?
 ff88ae320df3a493358395d2435df1d4550f1465 is the first bad commit
commit ff88ae320df3a493358395d2435df1d4550f1465
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Thu Jul 8 10:20:06 2021 +0200

    source 3069df790cca2917e5aedd87bac1af65f9605d51
    
    source 3069df790cca2917e5aedd87bac1af65f9605d51

 instdir/program/libscfiltlo.so | Bin 6044944 -> 6044944 bytes
 instdir/program/libsclo.so     | Bin 21509544 -> 21505672 bytes
 instdir/program/libscuilo.so   | Bin 911608 -> 911608 bytes
 instdir/program/setuprc        |   2 +-
 instdir/program/versionrc      |   2 +-
 5 files changed, 2 insertions(+), 2 deletions(-)


author	Balazs Varga <balazs.varga991@gmail.com>	2021-07-02 09:40:32 +0200
committer	Xisco Fauli <xiscofauli@libreoffice.org>	2021-07-08 09:50:09 +0200
commit 3069df790cca2917e5aedd87bac1af65f9605d51 (patch)
tree 34f62c2163805efc690c1aafc94bd36a48d3814c
parent 26846d1cee0f348d6aba464fbe7b27c04796884d (diff)
tdf#142910 sc filter: fix "greater than" or "smaller than" etc
Filter "greater than" or "smaller than" (>, <, >=, <=)
conditions according to the cell number format.

Regression from commit: d5c2584bf36d21580db677b231c57f99f49aa2cb
(Related: tdf#140968 avoid duplicated filter values)

Follow-up to commit: 1f755525189884e4b2824889a6b9dea8933402db
(tdf#142402 sc UI: store formatted values in standard filter)

Clean-up for commit: d5c2584bf36d21580db677b231c57f99f49aa2cb
(Related: tdf#140968 avoid duplicated filter values)

Change-Id: I1284892398c9964ca5407b4d617a617f20341107
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118272
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118593