roo-rb / roo

Roo provides an interface to spreadsheets of several sorts.
MIT License
2.79k stars 502 forks source link

Implied coordinates #549

Closed tahanson closed 2 years ago

tahanson commented 3 years ago

Summary

This change adds support for cells defined without a reference attribute. According to this older issue for a different project, the r (reference) attribute is not required: https://github.com/box/spout/issues/267 In this case, a cell's coordinates are to be determined based on location in the XML. I haven't been able to find documentation verifying that the reference attribute is actually optional but I have come across XLSX files that do not have the reference attribute. Also included are an example file and test. The PR does not address all parsing paths because significantly more changes were required. Specifically, when streaming rows, cells without an r attribute will still cause an error in Roo::Utils.extract_coordinate.

Other Information

It might be helpful to know the steps used to create the example file: