Bug 89546 - Single column Autofilter with "Not empty" shows empty cells
Summary: Single column Autofilter with "Not empty" shows empty cells
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:5.4.0
Keywords: bibisectRequest, regression
Depends on:
Blocks:
 
Reported: 2015-02-22 00:13 UTC by Teraslilja
Modified: 2017-12-14 17:26 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Two sheets - single column autofilter and two columns autofilter (17.97 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-02-22 00:13 UTC, Teraslilja
Details
Two sheets - single column autofilter and two columns autofilter, now with correct filter ranges. (9.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-10-13 12:54 UTC, Kari Salminen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Teraslilja 2015-02-22 00:13:04 UTC
Created attachment 113589 [details]
Two sheets - single column autofilter and two columns autofilter

Two column autofilter works as expected, when selected "Not empty".

Single column autofilter with "Not empty" *seems* to filter away only the empty cells *before* the first non-empty cell.

Added an attachment that demonstrates behaviour.
Comment 1 m_a_riosv 2015-02-22 01:12:39 UTC
Hi @Teraslilja, thanks for reporting.

Redoing the one column autofilter, seems to work better, "empty" selection works now, but in any case the last empty cell is showed with "no-empty" selection.
Comment 2 tommy27 2016-04-16 07:25:30 UTC Comment hidden (obsolete)
Comment 3 Kari Salminen 2016-09-28 12:21:36 UTC
Bug still occurs in a slightly changed form at least on
LibreOffice 5.2.1.2 (x64),
Build ID: 31dd62db80d4e60af04904455ec9c9219178d620,
OS: Windows 7 64-bit.

Two column AutoFilter works as expected,
single column AutoFilter doesn't.
Behaviour has changed from previously described behaviour.

Currently "Single-Column-AutoFilter-BAD"-tab
after opening file and clicking on Label-field's
AutoFilter-box and in it on "Not Empty":

 # Label
 3 A
 4 B
 6 C
 8 X
10 0
11
12 1
13

So rows with #-value of 1, 2, 5, 7 and 9 were
correctly filtered away having empty Label-value
but rows 11 and 13 were incorrectly left unfiltered.

If I redo the one column AutoFilter (i.e. remove it completely,
add it back and select "Not Empty" in it) then I get the same
behaviour as m.a.riosv on 2015-02-22 01:12:39 UTC i.e.
all but the last empty field is filtered correctly, resulting in:

 # Label
 3 A
 4 B
 6 C
 8 X
10 0
12 1
13
Comment 4 Kari Salminen 2016-09-28 12:52:13 UTC
Bug doesn't occur on LibreOffice 3.3.0 / OOO330m19 (Build:6) / tag libreoffice-3.3.0.4 on Windows 7 64-bit.

I installed the old version from http://downloadarchive.documentfoundation.org/libreoffice/old/3.3.0.4/win/x86/BrOffice_3.3.0_Win_x86_install_all_lang.exe

Because bug didn't occur on LibreOffice 3.3 I added "regression" to the keywords.
Comment 5 Xisco Faulí 2016-09-28 21:16:47 UTC
I can reproduce it in

Version: 4.2.0.0.alpha1+
Build ID: fc8f44e82de4ebdd50ac5fbb9207cd1a59a927e3

Thus, it can't be bibisected with bibisect-43max
Comment 6 Markus Mohrhard 2016-10-01 15:25:23 UTC
At least with the test file everything works ok.

302       <table:database-ranges> 
303         <table:database-range table:name="__Anonymous_Sheet_DB__0" table:target-range-address="'Multi-Column-AutoFilter-Ok'.C4:'Multi-Column-AutoFilter-Ok'.D17" table:display-filter-buttons="true"/> 
304         <table:database-range table:name="__Anonymous_Sheet_DB__1" table:target-range-address="'Single-Column-AutoFilter-BAD'.D4:'Single-Column-AutoFilter-BAD'.D14" table:display-filter-buttons="true"/> 
305       </table:database-ranges> 

So the autofilter range on the "BAD" sheet only covers the range until D14. ANd that part seems to work fine with the "Not empty" flag.
Comment 7 Kari Salminen 2016-10-03 05:25:02 UTC
(In reply to Markus Mohrhard from comment #6)
> At least with the test file everything works ok.
> 
> So the autofilter range on the "BAD" sheet only covers the range until D14.
> ANd that part seems to work fine with the "Not empty" flag.

  Ah, so that explains part of this bug. But what about the part where the filtering doesn't work even after redoing the autofilter completely from scratch so that its range does encompass all the rows? (Mentioned in comments 1 and 3) That results in this erroneous output:

 # Label
 3 A
 4 B
 6 C
 8 X
10 0
12 1
13
Comment 8 Kari Salminen 2016-10-13 12:54:16 UTC
Created attachment 127987 [details]
Two sheets - single column autofilter and two columns autofilter, now with correct filter ranges.

The same as the "113589: Two sheets - single column autofilter and two columns autofilter"-attachment but with the AutoFilter range of the second sheet corrected (i.e. D4-D17 now) and saved using LibreOffice 5.2.1.2 (x64), Build ID: 31dd62db80d4e60af04904455ec9c9219178d620 on Windows 7 64-bit.
Comment 9 Kari Salminen 2016-10-13 13:04:48 UTC
(In reply to Kari Salminen from comment #8)
> Created attachment 127987 [details]
> Two sheets - single column autofilter and two columns autofilter, now with
> correct filter ranges.
> 
> The same as the "113589: Two sheets - single column autofilter and two
> columns autofilter"-attachment but with the AutoFilter range of the second
> sheet corrected (i.e. D4-D17 now) and saved using LibreOffice 5.2.1.2 (x64),
> Build ID: 31dd62db80d4e60af04904455ec9c9219178d620 on Windows 7 64-bit.

  Now opening the attachment and clicking on the second sheet's AutoFilter and selecting "Not Empty" results erroneously in:

 # Label
 3 A
 4 B
 6 C
 8 X
10 0
12 1
13

And I'm using LibreOffice 5.2.1.2 (x64), Build ID: 31dd62db80d4e60af04904455ec9c9219178d620 on Windows 7 64-bit.

Thus I'm changing this back to the status this bug was before (i.e. NEW) this got closed as RESOLVED / WORKSFORME (Hopefully I'm not treading on any etiquette here by doing this. If I am then please correct the bug status as is appropriate, thank you).
Comment 10 m_a_riosv 2017-04-09 20:46:16 UTC
Maybe resolved as fixed by mistake.

I can reproduce the issue with the last row (empty) selected with 'Not Empty', on the sample file.

Version: 5.4.0.0.alpha0+
Build ID: 5a345f714f67594bb9e3f8914e89975a937872cf
CPU threads: 4; OS: Windows 6.19; UI render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-04-09_02:25:47
Locale: es-ES (es_ES); Calc: CL
Version: 5.3.2.2 (x64)
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: es-ES (es_ES); Calc: group
Comment 11 Commit Notification 2017-04-10 22:36:38 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

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

shrinking the DB area just causes problems, tdf#89546

It will be available in 5.4.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.