Add a patch to handle badly formed XLS files#281
Merged
Conversation
Owner
|
Thank you for the PR! Will do a new release now! |
zdavatz
added a commit
that referenced
this pull request
Apr 21, 2026
Includes PR #281 (handle badly formed XLS files). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
Successfully registered gem: spreadsheet (1.3.5) |
Contributor
Author
|
@zdavatz Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request addresses an edge case in reading Excel XLS files where some writers emit ROW records with empty cell ranges, which previously led to incorrect row data being returned. The fix ensures that valid cell data is preserved even when such ROW records are encountered. The most important changes are grouped below:
Bug Fix for Reading Rows with Empty Cell Ranges:
set_row_addressinlib/spreadsheet/excel/reader.rbto preserve the original row offset and block when a ROW record hasfirst_used == first_unusedbut cell data exists, preventing incorrect seeking and empty row results.Internal API changes:
row_addressesattribute inSpreadsheet::Excel::Worksheetto allow tracking and referencing row offsets during parsing.Test Coverage:
test_row_record_with_empty_cell_rangeintest/integration.rbto verify that rows with cell data are correctly read even when the ROW record claims no cells.The sample file is generated from scratch in order to be anonymous, but it has been tested against a full original file that exhibits the issue.