Bug 132120 - calc: macros: functionality 'getfilterfields' wrong result after load with active autofilter if databaserange has offset from cell A1
Summary: calc: macros: functionality 'getfilterfields' wrong result after load with ac...
Status: RESOLVED DUPLICATE of bug 133529
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-15 13:24 UTC by b.
Modified: 2020-06-05 06:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
testsheet with macro function to check results of call 'getfilterdescriptor' (14.48 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-15 13:30 UTC, b.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description b. 2020-04-15 13:24:30 UTC
Description:
see attached sheet - next comment. cell A1 calculates the column number (0-based!) of the filtered column in the database range C2:E16 by the macro call 'getfilterdescriptor'. 

(F9 is needed for recalc of A as it‘s a macro ‚function‘, thus excluded from autocalculate? or ist the exclusion reg. lack of info when variables for calculation change?) 

the value is wrong when the sheet is loaded with autofilter active - that's the bug, it becomes correct once you switch autofilter off and back on. 

it‘s needed to have one column filtered, otherwise error. 

My assumption after some tests: on fresh loaded sheet ‚getfilterdecriptor‘ calculates 'startcolumn of databaserange minus startrow of databaserange plus column in databaserange' ommitting 'startrow' if it's > 'startcolumn'. 

i've asked for this problem in 'ask', no answer, and initiated a thread in a german forum, no solution, searched the web, no solution. 

if someone can point me to the module where this calculation is done (where getfilterdescriptor is defined), the variables used there, and the logical path from the macro and it's variables to the module i'll try to look in the code ~ frightened!!! ~ a simple text search produced some results, but without knowledge about the structure and connections of the modules I feel helpless at first ... 

Steps to Reproduce:
see description above and steps in the attached sheet, 

Actual Results:
wrong calculation (wrong value for 'field' fetched by 'getfilterdescriptor') on sheets loaded with active autofilter, works better after off - on cycle for autofilter

Expected Results:
same results on fresh loaded sheets as later on, 


Reproducible: Always


User Profile Reset: Yes



Additional Info:
bug active since years, will update earliest affected after recheck, actual tested 7.0.0.0.a0+ from 2020-04-15, self compiled, sorry, ctrl-c ctrl-v to copy detailed info doesn't work (kali - debian - linux)
Comment 1 b. 2020-04-15 13:30:02 UTC
Created attachment 159584 [details]
testsheet with macro function to check results of call 'getfilterdescriptor'

testsheet
Comment 2 b. 2020-04-15 17:16:32 UTC
oldest version i had to test was 4.1.6.2, has problem with this macro, but doe's miscalculations with getfilterfields either, applying a new set filter - set by macro - one column left to the intended, healed after autofilter off and back on, 

i assume inherited from OOo ... ???
Comment 3 loin 2020-05-22 00:32:42 UTC Comment hidden (spam)
Comment 4 b. 2020-06-05 06:19:41 UTC
it boils down to something being unclear about the use of the flag/tag 'table:orientation="column"', described there: 

https://bugs.documentfoundation.org/show_bug.cgi?id=133529

as of now that's the main problem to be solved, thus setting this duplicate,

*** This bug has been marked as a duplicate of bug 133529 ***