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

            Bug ID: 167496
           Summary: FILESAVE XLSX Invalid ranges saved into sorted
                    autofilter
           Product: LibreOffice
           Version: 7.3.0.3 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: bibisected, bisected, implementationError
          Severity: normal
          Priority: medium
         Component: filters and storage
          Assignee: [email protected]
          Reporter: [email protected]
            Blocks: 104839, 123807

Created attachment 201785
  --> https://bugs.documentfoundation.org/attachment.cgi?id=201785&action=edit
Sample XLSX

The attached test file, which was based on an issue seen with
forum-mso-de-122145.xlsx (also attached), was created in Excel by adding
autofilter to a minimal set of data (2 columns), and sorting the first column
in the filter.
Open and save it back to XLSX, then try opening it in Excel.

=> Excel fails to open the file cleanly, and claims it found a problem with the
file. After attempting recovery, the file opens without further message.

This is the relevant part from xl/worksheets/sheet1.xml:
<autoFilter ref="A3:B3">
  <sortState ref="A4:B6">
    <sortCondition ref="A3"/>
  </sortState>
</autoFilter>

Here's the same part from the exported file:
<autoFilter ref="A3:B3">
  <sortState ref="A4:B3">
    <sortCondition ref="A4:A3" customList=""/>
  </sortState>
</autoFilter>

Note the 'sortState' ref, which is an invalid range: "A4:B3", and the
'sortCondition' ref, where "A4:A3" is equally invalid.

This issue is an implementation error in 7.1 from the following commit:
https://git.libreoffice.org/core/commit/a9f8f0a484965338221cad4f97d98f418b5ccff1
https://cgit.freedesktop.org/libreoffice/core/commit/?id=a9f8f0a484965338221cad4f97d98f418b5ccff1
author          Serge Krot <[email protected]>  2020-06-29 13:23:34 +0200
committer       Thorsten Behrens <[email protected]>      2020-09-08
12:51:17 +0200

"tdf#95640 XLSX: import/export of custom sort lists"

Before that, the same exported XML part looked like this (no 'sortState' was
exported):
<autoFilter ref="A3:B3"/>

Still in LO 26.2.0.0.alpha0+ (697fadb8f4efdc09091088261ca1b43984c029b4) /
Windows.

A specialty of this file is that the autofilter was created in Excel by
selecting the header cells, and those only, and clicking the filter button.
Selecting the whole data area, and creating the autofilter that way will
produce different XML that doesn't exhibit the bug.


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104839
[Bug 104839] [META] Saved XLSX files that MS Excel can't open
https://bugs.documentfoundation.org/show_bug.cgi?id=123807
[Bug 123807] [META] XLSX (OOXML) Autofilter-related bugs
-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to