Bug 138438 - CALC AutoFilter Top 10 malfunctions when another column is already filtered
Summary: CALC AutoFilter Top 10 malfunctions when another column is already filtered
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Balázs Varga
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: AutoFilter
  Show dependency treegraph
 
Reported: 2020-11-23 19:05 UTC by Colin
Modified: 2021-06-10 13:36 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Complete File demonstrating the error (53.97 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-11-23 19:06 UTC, Colin
Details
Simple reproducer document (9.06 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-05-06 06:17 UTC, NISZ LibreOffice Team
Details
"Unfiltered" simple reproducer document (10.02 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-05-07 11:49 UTC, Colin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Colin 2020-11-23 19:05:03 UTC
Description:
When an array column has been filtered to exclude a number of specific entries the selection of "top 10" in any other column's filter returns an empty array.
When the recalcitrent filter is then amended to select "all" it remains empty - the "all" selection is simply ignored.
Choosing  "Not Empty" then re-establishes a positive array which can be further manipulated. "All" can then be selected and functions as expected.

Steps to Reproduce:
Sample File "Filter Error" attached
Column B has already been filtered to sort inverted and column C has been filtered to exclude the final 6 days of November.
1 Filter column J "Top Ten" - observe the effect
2 Filter column J "All" - observe the effect
3 Filter column J "Not Empty" - observe the effect
4 Filter column C "All" - observe the effect
5 Repeat steps 1 & 2 - observe the effect

Note: The division by zero error in K3 & L3 is obviously anticipated 


Actual Results:
Entire array disappears

Expected Results:
Top 10 filter


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: sv-SE (en_GB); UI: en-GB
Calc: threaded
Comment 1 Colin 2020-11-23 19:06:06 UTC
Created attachment 167511 [details]
Complete File demonstrating the error
Comment 2 m_a_riosv 2020-11-24 08:38:26 UTC
Repro
Version: 7.1.0.0.alpha1+ (x64)
Build ID: 72056f39e01e36afac36c62988331b6813c8214f
CPU threads: 4; OS: Windows 10.0 Build 20180; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL
Comment 3 NISZ LibreOffice Team 2021-05-06 06:17:59 UTC
Created attachment 171667 [details]
Simple reproducer document
Comment 4 Colin 2021-05-07 11:48:30 UTC
(In reply to NISZ LibreOffice Team from comment #3)
> Created attachment 171667 [details]
> Simple reproducer document

Experimenting further with the simplified reproducer, it also exhibits an anomaly in the display of the "drop-down" filter pane for "Values" following the instruction to display "not empty".

You will observe that the inverted triangle in the "Values" filter button is blue - signifying an active filter even though the filter for "something" has been reset to "all".

I'm not sure whether this is a true representation as the filter to display "not empty" could indeed be considered active
BUT
observing the possible elements in that drop-down, you will notice that all the element tick boxes are blank - I would have expected them to be ticked and possibly even the "all" tick-box to be either active or filled with the "black square".  The status at this time is ambiguous;
All elements are active - show them as ticked
or
All elements are inactive - activate them

I have attached the "unfiltered" reproducer which demonstrates the anomaly and more simply defines the description.

My apologies if this has simply added verbosity to what was a fairly simple report and the assignee would have automatically noted and remedied every anomaly as part of the patch process.
Comment 5 Colin 2021-05-07 11:49:36 UTC
Created attachment 171744 [details]
"Unfiltered" simple reproducer document
Comment 6 NISZ LibreOffice Team 2021-05-10 07:58:55 UTC
Hi Colin

I think you are experiencing this one:
Bug 68113 - [UI] [Autofilter] Selecting "Not empty" unchecks all entries
Comment 7 Colin 2021-05-10 08:15:33 UTC
(In reply to NISZ LibreOffice Team from comment #6)
> Hi Colin
> 
> I think you are experiencing this one:
> Bug 68113 - [UI] [Autofilter] Selecting "Not empty" unchecks all entries

Hi NISZTeam,

Are you referencing my comment #4 + attachment?

I agree my latest observation appears to replicate 68113 but do you feel my initial report is also the same issue?

It "feels" more significant.
Comment 8 Commit Notification 2021-05-28 10:15:05 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fbfb57635b602b50cb22465047ae5bcdbef3dd0a

tdf#138438 sc: fix "Top 10" autoFilter in multiple columns

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 NISZ LibreOffice Team 2021-06-10 13:36:20 UTC
Verified in: 

Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: aa9cb8e14749e7fb7a83b55a2bb095501f731a18
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded