tafia / calamine

A pure Rust Excel/OpenDocument SpreadSheets file reader: rust on metal sheets
MIT License
1.61k stars 155 forks source link

Allow handling empty string value in xls formula parsing #348

Closed 7Towers closed 10 months ago

7Towers commented 11 months ago

343

Simple fix to handle empty string values when parsing XLS formulas. Based on MS recommendations. Fixes the issue I've faced in my projects.

dimastbk commented 11 months ago

Test file - issue_343.xls (put ="" in A1).

tafia commented 11 months ago

Yes please add a test. Thanks!

dimastbk commented 10 months ago

I think, 0x03 should return DataType::String("".to_string()), because empty cell != zero-lenght string cell. See for example xlrd and sheetjs.

jqnatividad commented 10 months ago

Hope you don't mind @7Towers , but I went ahead and implemented an alternate PR using @dimastbk 's recommendation to return an empty string, using the test file he provided.

Hopefully, when this gets merged, the next calamine release will be published by @tafia 😉 🤞

7Towers commented 10 months ago

Great job @jqnatividad. Your PR is better for the project.