Bug 112258 - UI Autofilter on date cells: Filter result doesn't correspond to user input, user input is modified automatically
Summary: UI Autofilter on date cells: Filter result doesn't correspond to user input, ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: All All
: high major
Assignee: Eike Rathke
URL:
Whiteboard: target:6.0.0 target:5.4.2
Keywords: regression
: 113111 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-09-06 17:32 UTC by Stefan_Lange_KA@T-Online.de
Modified: 2017-10-14 09:02 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
spreadsheet to demonstrate the behavior (9.11 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-09-06 17:32 UTC, Stefan_Lange_KA@T-Online.de
Details
other spreadsheet to demonstrate the behavior (13.92 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-09-07 14:40 UTC, Stefan_Lange_KA@T-Online.de
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan_Lange_KA@T-Online.de 2017-09-06 17:32:44 UTC
Created attachment 136074 [details]
spreadsheet to demonstrate the behavior

When in a sheet with date cells autofilter is set, the filter results do not correspand the selected filter criteria.
Furthermore the filter function needs quite many time and - very bad - the filter criteria entered by the user are "automatically" changed while filter works.

Steps to reproduce:
- open the attached small spreadsheet "Test_Autofilter_Date.ods"
Step 1:
- click on the autofilter arrow in column A ("Datum"), unselect "All" and select one or more years -> presss OK
Result: 
- expected: only rows with date in selected years are filtered
- actually: Not only the selectd years are filtered, but all rows except the empty rows
Remark: In other cases not all rows are selected 
Step 2: 
- click on the autofilter arrow in column a again
Result:
- expected: only the years selected in Step 1 are selected in the filter list
- actually: all years except "empty" are selected in the filter list (this corresponds to the filter result from Step 1) 

Remark: In other cases (most of my own spreadsheets) not all years are automatically selected in the filter list by filter function, but nearly never the selection entered by the user is kept.

The bug was reproduced with LO 5.4.0, LO 5.4.1 and LO 6.0.0.0.alpha0. In LO 5.3.5 the autofilter on date cells works properly.
Comment 1 Jacques Guilleron 2017-09-07 10:33:38 UTC
Hi Stefan,

Reproduced with
LO 5.4.0.0.alpha0+ Build ID: 98ebfb6a8638a76e96ffe7ada2485b3d13ed1fb9
CPU threads: 2; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-04-11_01:03:05
Locale: fr-FR (fr_FR); Calc: CL
and upper versions.
but not with
LO 5.4.0.0.alpha0+ Build ID: 1cd7edadfedc8bf55b979449cbb084082a888e89
CPU threads: 2; OS: Windows 6.1; UI render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-03-30_03:06:30
Locale: fr-FR (fr_FR); Calc: CL
where the (empty) item didn't exist at the end of in the selectable dates list.
Comment 2 Stefan_Lange_KA@T-Online.de 2017-09-07 11:59:34 UTC
Hi Jacques,
this can be (bug not reproducible with LO 5.4.0 older than 2017-04-11_01:03:05).
In February 2017 was reported the Bug 106214 also related to autofilter on date cells. It was fixed by a patch from Markus Morhard in LO 5.4.0 on 2017-03-27 00:58:26 UTC. My test on 2017-03-27 07:31:10 UTC was succesful, means at this time were no problems in autofilter on date cells in LO 5.4.0.
Comment 3 Eike Rathke 2017-09-07 14:34:23 UTC
The filter range (anonymous database-range) is defined to A1:B1048576 that's why it takes so long. Removing the AutoFilter once and re-establishing cures that. The described filtering problem pertains though.
Comment 4 Stefan_Lange_KA@T-Online.de 2017-09-07 14:40:30 UTC
Created attachment 136096 [details]
other spreadsheet to demonstrate the behavior

The new test file "Test_Autofilter_Date_V2.ods" is a sample, that not always all years are selected as result of the autofilter function, e.g.:
- select 1983 on the autofilter: -> row with year 1983 is filtered -> OK
- select year 2008: -> rows with 11/2008 and 12/2008 are filtered (OK) and also rows 11/2010 and 12/2010 (wrong)
- select month 12/2008: rows with 12/2008 (OK) and 12/2010 (wrong) are filtered
- select month 03/2010 (or 03/2009): rows with 03/2009 and 03/2010 are filtered
- select month 05/2009 (or 05/2010): rows with 05/2009 and 05/2010 are filtered, but not the row with 05/1983 (?)
Comment 5 Stefan_Lange_KA@T-Online.de 2017-09-07 15:15:52 UTC
Answer to Comment 3:
Many thanks for this hint! The filter works now very much faster.
Comment 6 Eike Rathke 2017-09-07 15:45:31 UTC
Regression was introduced by a combination of commit 2a39dc74724d3648ff76aa900edfebe0dd19b296 that tried to fix a regression from commit 511fb8e80d298d42f5c45e7410bf64f2a25b441e, both for bug 108259. Went into 5.4 as combined commit 0163957ef808cffa332c2ddd3267409c5ae1494a.

Taking.
Comment 7 Commit Notification 2017-09-07 20:06:22 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bece4b6715cfec8eaaa6ee97bade92521d1e2d18

Resolves: tdf#112258 correctly pick items from AutoFilter selection

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Eike Rathke 2017-09-07 20:13:33 UTC
Pending review https://gerrit.libreoffice.org/42085 for 5-4
Comment 9 Stefan_Lange_KA@T-Online.de 2017-09-08 07:23:25 UTC
Tests with

Version: 6.0.0.0.alpha0+ (x64)
Build-ID: fc670f637d4271246691904fd649358ce2e7be59
CPU-Threads: 4; Betriebssystem:Windows 6.19; UI-Render: GL; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2017-09-08_00:38:22
Gebietsschema: de-DE (de_DE); Calc: CL

were OK as well with the attached test spreadsheets as with real spreadsheets of mine.
Comment 10 Commit Notification 2017-09-08 11:15:16 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fd5ac4c4f5de9ef475156dafcba1b37a56b5cb8d

If children then insert only if a child is selected, tdf#112258 follow-up

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 11 Jacques Guilleron 2017-09-09 08:52:01 UTC
Hi,

Works as expected, Test_Autofilter_Date_V2.ods included, with
LO  6.0.0.0.alpha0+ Build ID: a45800f010f3e063c6f31426fcdba76aa5b43d3e
CPU threads: 2; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2017-09-09_00:43:08
Locale: fr-FR (fr_FR); Calc: CL
Thank you very much, Eike
Comment 12 Stefan_Lange_KA@T-Online.de 2017-09-09 12:21:21 UTC
Are there already news to the patch for LO 5.4 (see Comment 8)?
Comment 13 Commit Notification 2017-09-15 10:37:26 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7f208a5287a6eda301b0c3c797d5e21181ce27d2&h=libreoffice-5-4

Resolves: tdf#112258 correctly pick items from AutoFilter selection

It will be available in 5.4.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 14 Stefan_Lange_KA@T-Online.de 2017-09-17 22:37:03 UTC
I have repeated the Tests from Comment 9 with

Version: 5.4.2.1 (x64)
Build-ID: dfa67a98bede79c671438308dc9036d50465d2cb
CPU-Threads: 4; Betriebssystem:Windows 6.19; UI-Render: GL; 
Gebietsschema: de-DE (de_DE); Calc: group

Result: Works as expected, no problems!
Comment 15 Emil Tanev 2017-10-14 09:02:32 UTC
*** Bug 113111 has been marked as a duplicate of this bug. ***