Bug 148812

Summary: [FILEOPEN] [FILESAVE] XLS -> XLSX bad translation of defined names
Product: LibreOffice Reporter: SheetJS <dev>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: himajin100000, ilmari.lauhakangas, raal
Priority: medium Keywords: filter:xls, filter:xlsx
Version: 7.3.2.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 104839    
Attachments: specimen

Description SheetJS 2022-04-26 21:34:05 UTC
Description:
LO can read files with "\x2e" (".") in defined names from an XLS file.  When saving the files to XLSX, those characters are replaced with "\x5f" ("_").  It may be an issue with the XLS import filter or the XLSX export filter.  Since the test files were generated using LibreOffice save as XLS, the XLS export filter does not exhibit the issue.

Steps to Reproduce:
Open attachment and save as XLSX, then try opening the file in Excel

Actual Results:
File opens

Expected Results:
Excel reports file is invalid


Reproducible: Always


User Profile Reset: Yes



Additional Info:
The XLS file has the correct defined name:

```js
> require("xlsx").readFile("locrash.xls")?.Workbook?.Names?.map(x => x.Name)
[ '_xlfn.UNICHAR' ]
```

The generated XLSX does not:

```js
> require("xlsx").readFile("locrash.xlsx")?.Workbook?.Names?.map(x => x.Name)
[ '_xlfn_UNICHAR' ]
```

(note that the "." was replaced with "_")
Comment 1 SheetJS 2022-04-26 21:34:42 UTC
Created attachment 179795 [details]
specimen
Comment 2 Buovjaga 2023-01-31 12:46:16 UTC
I guess I repro as office.com says:
Removed Records: Named range from /xl/workbook.xml part (Workbook)

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a345952daf3238066ecb1a9c67bb6a3640a6299a
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 31 January 2023