Repository navigation
Read the cells of a row that omits its index - #10
Merged
Merged
Conversation
A <row> without r is valid (the attribute is optional in ECMA-376 18.3.1.73) and means the row after the previous one, yet the SAX reader left the row index at -1 and dropped every cell in it, even one placed by its own r="A1". An unindexed row after an indexed one reused the previous row's index, so positional cells overwrote it. The index is now inferred when absent, a cell with its own reference is always placed, and the row's ht/hidden/outline attributes are applied after the index is known rather than in attribute order. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Problem.
<row>withoutris valid (the attribute is optional inECMA-376 18.3.1.73) and means the row after the previous one. The SAX reader
left the row index at −1 and dropped every cell in such a row, even one placed
by its own
r="A1"; an unindexed row after an indexed one reused the previousrow's index, so positional cells overwrote it. openpyxl reads
<row><c r="A1"><v>42</v></c></row>as A1 = 42; the library returned null anddropped the value on save. Inherited from the original package.
A second effect of the same loop:
ht,hidden,outlineLevelandcollapsedwere applied as they were met, so a writer that puts them beforerattached them to the previous row.Fix. The row index is inferred when
ris absent, a cell carrying its ownreference is always placed by it, and the row's attributes are applied once
the index is known.
Validation.
test/reader_test.dart, "Rows Without Explicit Indices":omitted
rwith an explicit cell, an unindexed row afterr="3"(A3, A4,B4, matching openpyxl's reading of the same file), rows with no index at all,
and attributes written before
r. All fail before, pass after; suite andanalyzer clean.
🤖 Generated with Claude Code