Bug 111939 - Toggling off Autofilter with VBA macro does not restore filtered rows
Summary: Toggling off Autofilter with VBA macro does not restore filtered rows
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Dennis Francis
URL:
Whiteboard: target:6.0.0 target:5.4.2
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2017-08-21 09:31 UTC by Tamas Bunth
Modified: 2017-09-03 04:46 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Reproduce (14.75 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2017-08-21 09:33 UTC, Tamas Bunth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tamas Bunth 2017-08-21 09:31:52 UTC
Description:
Toggling off Autofilter with VBA macro does not restore filtered rows.

Steps to Reproduce:
- Open attached xlsm file
- Run macro (this toggles AutoFilter on with specific filters and toggles it off afterwards)

Actual Results:  
Autofilter toggled off (filtering buttons disappeared, as expected), but the rows which have been hidden by the filter are not restored.

Expected Results:
Every row of the previously filtered column should be visible.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0
Comment 1 Tamas Bunth 2017-08-21 09:33:17 UTC
Created attachment 135691 [details]
Reproduce
Comment 2 raal 2017-08-21 20:50:46 UTC
LO 6 - error when run macro: BASIC runtime error.
'91'

Type: com.sun.star.lang.WrappedTargetRuntimeException
Message: non-RuntimeException occurred when accessing an interface type attribute
Comment 3 Aron Budea 2017-08-21 22:59:38 UTC
Raal, how old is your build? The commits that make the code work in general are from a week or two ago, so it won't work with builds before that time.

Tamas, for me it behaves fine, all rows are shown as expected, tested with a daily build from 08-11 and a recent master build from 08-19 (e62a8f333332688203867fdddbc8ffa89a657b9f) in Windows 7. Could it be OS-dependent?
Comment 4 Tamas Bunth 2017-08-22 19:36:50 UTC
I tried out with a fresh build, the bug is still present on my machine.

Interesting...

Version: 6.0.0.0.alpha0+
Build ID: 33b094a8949c34756c593bfad52450ec2b7daa54
CPU threads: 4; OS: Linux 4.12; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 5 raal 2017-08-23 07:37:14 UTC
I can confirm with Version: 6.0.0.0.alpha0+
Build ID: 0e35b7738d9f276c0566df0f2cc0f1eed7900d6c
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-08-22_01:24:19

and Version: 6.0.0.0.alpha0+
Build ID: 1ba1bb96659d0048bff2a9a15646f6e1e04bd2c4
CPU threads: 1; OS: Windows 6.19; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-08-22_23:41:55

Actual Results:  
Autofilter toggled off (filtering buttons disappeared, as expected), but the rows which have been hidden by the filter are not restored.
Comment 6 Commit Notification 2017-08-31 12:47:23 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

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

tdf#111939: Fallback to getting view data from best view shell...

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 7 Commit Notification 2017-09-01 07:44:29 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

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

tdf#111939: Fallback to getting view data from best view shell...

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.