Closed mnoble closed 12 years ago
Wow. That's weird. Good catch.
Can you add a test case for the Sheets::Parsers::NokogiriXlsxParser? I'm cool to pull this once there's a test.
Updated.
The Excel file I added for this test is kind of mangled (data wise) because I had to remove a bunch of private stuff. The xml attributes are all setup correctly though; two worksheets (id 1 and 3).
Here's a link to the exception that was being raised as well: https://gist.github.com/3829072
Excel worksheets get an id when they are created. When worksheets are removed, it seems as though id's are not reassigned, but their filenames are. For example:
If you delete the second worksheet, the filenames change, but the ids do not, it seems. What you end up with is:
The current XLSX parser assumes the filename of a worksheet contains its id. This is not the case for the example above.
This change makes it load worksheets sequentually, from 1 to the number of worksheets, instead of id (which doesn't change). Assuming the worksheet filenames are changed when adding/removing worksheets, this should work.