<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - calc: macros: functionality 'getfilterfields' wrong result after load with active autofilter if databaserange has offset from cell A1"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=132120">132120</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>calc: macros: functionality 'getfilterfields' wrong result after load with active autofilter if databaserange has offset from cell A1
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Calc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>newbie-02@gmx.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>