Created attachment 163101 [details]
Example file from Excel with 253 characters in the header
In Excel there is a limitation on the combined text length of the header/footer text of 255 characters, including the left/center/right parts and all formatting, documented in [MS-OI29500] under:
2.1.619 Part 1 Section 220.127.116.11, firstFooter (First Page Footer)
2.1.620 Part 1 Section 18.104.22.168, firstHeader (First Page Header)
2.1.631 Part 1 Section 22.214.171.124, oddFooter (Odd Page Footer)
2.1.632 Part 1 Section 126.96.36.199, oddHeader (Odd Header)
2.1.1455 Part 1 Section 188.8.131.52, evenFooter (Even Footer)
2.1.1456 Part 1 Section 184.108.40.206, evenHeader (Even Header)
do not mention it, at least in my copy.)
The Excel GUI enforces this limit at document creation time, but Calc does not. Consequently it is possible to create headers/footers of 255 character or longer, save them as XLSX which causes an “Invalid contents detected” warning in Excel.
Steps to reproduce:
1. Open attached file in Calc
2. Go to Insert – Headers and footers
3. Add one more character to the header, save the file and open it in Excel
Excel detects invalid contents in the file. If you let it fix, it will remove all the sheet properties from /xl/worksheets/sheet1.xml
Calc could have an option to enforce 255 character header / footer length limit at editing time, for OOXML-heavy environments.
Version: 220.127.116.11.alpha0+ (x64)
Build ID: f7eff4319be741143f6d8d5e0f2995e3ce46b126
CPU szálak: 4; OS: Windows 6.3 Build 9600; Felületmegjelenítés: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Created attachment 163102 [details]
The example file edited in LO7 with one more character in the header
Created attachment 163103 [details]
The two example files in Calc
Created attachment 163104 [details]
Opening the file with 255 character long header in Excel gives invalid contents warning
Created attachment 163105 [details]
Warning from Excel when the limit is reached at editing time
Something like this would be nice to have.
Created attachment 163108 [details]
attachment #163102 [details] (the invalid xlsx) saved to xls by Calc
Turns out this situation is already handled for xls: too long header text gets truncated without warning, making it work in Excel.
Applying this magic to xlsx could be a compromise too.