Bug 170287 - FILESAVE: ODS/XLS -> XLSX font name exceeds max length of 31
Summary: FILESAVE: ODS/XLS -> XLSX font name exceeds max length of 31
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
26.8.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Karthik
URL:
Whiteboard: target:26.8.0 target:26.2.2
Keywords:
: 129367 (view as bug list)
Depends on:
Blocks: Fonts XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2026-01-10 11:43 UTC by Karthik
Modified: 2026-02-06 11:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
XLS File (41.50 KB, application/vnd.ms-excel)
2026-01-10 11:45 UTC, Karthik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karthik 2026-01-10 11:43:55 UTC
Description:
Open the attached XLS file and save it as XLSX in LibreOffice. Excel throws an error when opening the resulting file.

OOXML Validator gives the below error
```
  {
    "Description": "The attribute 'val' has invalid value 'Cumberland;Cumberland AMT;Courier New;Cousine;Liberation Mono;Nimbus Mono L;DejaVu Sans Mono;Bitstream Vera Sans Mono;Courier;Lucida Sans Typewriter;Lucida Typewriter;Monaco;Monospaced'. The actual length is greater than the MaxLength value. The length must be smaller than or equal to 31.",
    "Path": {
      "Namespaces": {},
      "XPath": "/x:styleSheet[1]/x:fonts[1]/x:font[5]/x:name[1]",
      "PartUri": "/xl/styles.xml"
    },
    "Id": "Sem_AttributeValueDataTypeDetailed",
    "ErrorType": "Schema"
  }
```

The font name exceeds maximum length of 31. But I couldn't find where this is specified. Schema related to font element is specified in (ISO-IEC-29500-1 2016, 18.8.22). But there is no limit on font-name length.

Limiting the font-name to 31 in `styles.xml` fixes the issue

Steps to Reproduce:
1. Open the attached XLS file
2. Save it as XLSX
3. Open the resulting file in Excel

Actual Results:
Excel throws an error when opening the file

Expected Results:
Excel opens the file without any problem


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 22; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded
Comment 1 Karthik 2026-01-10 11:45:08 UTC
Created attachment 204995 [details]
XLS File
Comment 2 Commit Notification 2026-02-04 17:40:08 UTC
Karthik Godha committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6cb419f2dc829abf6472c4407afb8c09a9571ac3

tdf#170287: XLS->XLSX Limit font-name length to 31

It will be available in 26.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.
Comment 3 Commit Notification 2026-02-06 10:42:40 UTC
Karthik Godha committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/84c1427aca2dca7189840160c4e877cd73ae0d4c

tdf#170287: XLS->XLSX Limit font-name length to 31

It will be available in 26.2.2.

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.
Comment 4 Aron Budea 2026-02-06 11:04:13 UTC
*** Bug 129367 has been marked as a duplicate of this bug. ***