Skip to content

Can't load basic spreadsheets created in Google Docs #64

@grin

Description

@grin

Version
'~> 0.6.1'

Describe the bug
Error I'm getting when trying to load very basic spreadsheets:

error: valueNotFound(CoreXLSX.Fonts, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "fonts", intValue: nil)], debugDescription: "Expected Fonts value but found null instead.", underlyingError: nil))

To Reproduce
HelloWorld.xlsx
Blank.xlsx

Attaching two files which fail to load with the below code:

        let f = Bundle.main.url(forResource: "Models.scnassets/levels/HelloWorld", withExtension: "xlsx")!
        guard let file = XLSXFile(filepath: f.path) else {
            fatalError("XLSX file corrupted or does not exist")
        }
      
        do {
            let styles = try file.parseStyles()
            
            let ws = try file.parseWorksheet(at: "xl/worksheets/sheet1.xml")
            for row in ws.data?.rows ?? [] {
                for c in row.cells {
                    print(c)
                }
            }
        } catch CoreXLSXError.archiveEntryNotFound {
              print("CoreXLSXError.archiveEntryNotFound")
        } catch {
            print("error: \(error)")
        }

Expected behavior
The files should load and just ignore empty border/font tags similar to this:

<borders count="1"><border/></borders>
<fonts count="2"><font><sz val="10.0"/><color rgb="FF000000"/><name val="Arial"/></font><font/></fonts>

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions