Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implied coordinates #549

Merged
merged 2 commits into from
Mar 19, 2022
Merged

Implied coordinates #549

merged 2 commits into from
Mar 19, 2022

Conversation

tahanson
Copy link
Contributor

@tahanson tahanson commented Oct 27, 2020

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:
box/spout#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:

  • create an XLSX file with LibreOffice
  • unzip the file into an empty directory: unzip test.xlsx -d emptydir
  • edit xl/worksheets/sheet1.xml file so that all c elements do not have an r attribute. I also converted the cell definitions to be inline: <c s="0" t="inlineStr"><is><v>Test</v></is></c>.
  • removed the xl/sharedStrings.xml (since all values were changed to inline) and the docProps directory to minimize the contents
  • zip the file up with .xlsx extention

@simonoff simonoff merged commit 0aaf0d5 into roo-rb:master Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants