Bug 165130 - FILESAVE XLSX: corrupt warning from Excel 2019 when topLeftCell is in frozen zone
Summary: FILESAVE XLSX: corrupt warning from Excel 2019 when topLeftCell is in frozen ...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.8.0
Keywords: filter:xlsx
Depends on:
Blocks: XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2025-02-08 15:54 UTC by Justin L
Modified: 2025-02-08 17:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
custom frozen spreadsheet.xlsx: hand-modified to force wrong topLeftCell (7.53 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-02-08 15:54 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-02-08 15:54:54 UTC
Created attachment 199074 [details]
custom frozen spreadsheet.xlsx: hand-modified to force wrong topLeftCell

The problem occurs during export, if the sheet has a frozen view and somehow the bottom-right pane is showing some of the frozen range. In this case, it was writing the topLeftCell as a cell that shouldn't be possible. This has not always been a problem..., Excel 2010 opens this just fine. (It just displays like Calc - showing a split screen.) However at least Excel 2019 complains about a corrupt view. It then "deletes" the "corrupt" view and so the user loses the freeze line(s).

Probably generated by multiuser online, this can also occur during a file-open of an already "corrupted" document.

Steps to reproduce
1.) open custom frozen spreadsheet.xlsx in LO. (Excel already complains it is corrupted.)
2.) save and reload in Excel.

LO has not "fixed" the document, but still round-trips it corrupted, showing that is it possible to potentially create a corrupt xlsx file in certain circumstances.

[When opening the document, notice that the bottom right pane is showing cell A1 again. That shouldn't be possible for a frozen sheet. The freeze is still in place, and will "activate" once you move right/down enough.]
Comment 1 Commit Notification 2025-02-08 17:40:58 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5ef44a0b2ad238fbd13196e2f602de71f42a34d1

tdf#165130 sc: prevent pane's topLeftCell from being in frozen zone

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.