Bug 134855 - EDITING Header text has character limit in Excel which can be broken by Calc
Summary: EDITING Header text has character limit in Excel which can be broken by Calc
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks: XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2020-07-16 09:12 UTC by NISZ LibreOffice Team
Modified: 2020-07-31 04:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel with 253 characters in the header (9.93 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-07-16 09:12 UTC, NISZ LibreOffice Team
Details
The example file edited in LO7 with one more character in the header (5.06 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-07-16 09:12 UTC, NISZ LibreOffice Team
Details
The two example files in Calc (81.86 KB, image/png)
2020-07-16 09:13 UTC, NISZ LibreOffice Team
Details
Opening the file with 255 character long header in Excel gives invalid contents warning (39.05 KB, image/png)
2020-07-16 09:14 UTC, NISZ LibreOffice Team
Details
Warning from Excel when the limit is reached at editing time (58.66 KB, image/png)
2020-07-16 09:14 UTC, NISZ LibreOffice Team
Details
attachment #163102 (the invalid xlsx) saved to xls by Calc (6.00 KB, application/vnd.ms-excel)
2020-07-16 09:48 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-07-16 09:12:31 UTC
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 18.3.1.41, firstFooter (First Page Footer) 
2.1.620 Part 1 Section 18.3.1.42, firstHeader (First Page Header) 
2.1.631 Part 1 Section 18.3.1.57, oddFooter (Odd Page Footer) 
2.1.632 Part 1 Section 18.3.1.58, oddHeader (Odd Header) 

(although
2.1.1455 Part 1 Section 21.2.2.59, evenFooter (Even Footer) 
2.1.1456 Part 1 Section 21.2.2.60, 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

Actual results:
Excel detects invalid contents in the file. If you let it fix, it will remove all the sheet properties from /xl/worksheets/sheet1.xml

Expected results:
Calc could have an option to enforce 255 character header / footer length limit at editing time, for OOXML-heavy environments.

LibreOffice details:
Version: 7.1.0.0.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
Calc: CL
Comment 1 NISZ LibreOffice Team 2020-07-16 09:12:50 UTC
Created attachment 163102 [details]
The example file edited in LO7 with one more character in the header
Comment 2 NISZ LibreOffice Team 2020-07-16 09:13:13 UTC
Created attachment 163103 [details]
The two example files in Calc
Comment 3 NISZ LibreOffice Team 2020-07-16 09:14:05 UTC
Created attachment 163104 [details]
Opening the file with 255 character long header in Excel gives invalid contents warning
Comment 4 NISZ LibreOffice Team 2020-07-16 09:14:48 UTC
Created attachment 163105 [details]
Warning from Excel when the limit is reached at editing time

Something like this would be nice to have.
Comment 5 NISZ LibreOffice Team 2020-07-16 09:48:27 UTC
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.