fix(sheet): omit hidden rows and columns in OOXML xlsx - #90
Open
HaoChiBao wants to merge 2 commits into
Open
Conversation
Calamine does not expose worksheet row/col hidden attrs, so stream them from sheetN.xml and omit those axes when building tables. Addresses the remaining row/column half of firecrawl#9 without racing PR firecrawl#39 sheet visibility.
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/formats/sheet/mod.rs">
<violation number="1" location="src/formats/sheet/mod.rs:88">
P2: When a merged range has a hidden top-left row or column, this `continue` bypasses registration of its visible covered cells. Any raw values in those cells then leak into the document and Markdown; blank or suppress the visible covered positions while dropping the hidden origin.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Comment on lines
+88
to
+92
| if axis_row_hidden(hidden, start.0 + r0 as u32) | ||
| || axis_col_hidden(hidden, start.1 + c0 as u32) | ||
| { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
P2: When a merged range has a hidden top-left row or column, this continue bypasses registration of its visible covered cells. Any raw values in those cells then leak into the document and Markdown; blank or suppress the visible covered positions while dropping the hidden origin.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/formats/sheet/mod.rs, line 88:
<comment>When a merged range has a hidden top-left row or column, this `continue` bypasses registration of its visible covered cells. Any raw values in those cells then leak into the document and Markdown; blank or suppress the visible covered positions while dropping the hidden origin.</comment>
<file context>
@@ -65,22 +76,51 @@ pub fn parse(bytes: &[u8]) -> Result<Document, ConvertError> {
+ }
+ // Value lives at the merge origin; if that axis is hidden, drop
+ // the merge so remaining visible covered cells stay empty.
+ if axis_row_hidden(hidden, start.0 + r0 as u32)
+ || axis_col_hidden(hidden, start.1 + c0 as u32)
+ {
</file context>
Suggested change
| if axis_row_hidden(hidden, start.0 + r0 as u32) | |
| || axis_col_hidden(hidden, start.1 + c0 as u32) | |
| { | |
| continue; | |
| } | |
| if axis_row_hidden(hidden, start.0 + r0 as u32) | |
| || axis_col_hidden(hidden, start.1 + c0 as u32) | |
| { | |
| for &r in &visible_rows { | |
| for &c in &visible_cols { | |
| covered.insert((r, c)); | |
| } | |
| } | |
| continue; | |
| } |
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.
Related to #9 (row/column half). Does not close #9; coexist with #39 (sheet-level half).
Summary
<row hidden>/<col hidden>from OOXML worksheet parts (calamine does not expose them)Out of scope
Test plan
cargo fmt, clippy-D warnings,cargo test --locked --libSummary by cubic
Omits hidden rows and columns in OOXML
.xlsx/.xlsmso hidden content no longer appears in generated tables and Markdown. Previously we rendered hidden axes becausecalaminedoes not expose<row hidden>/<col hidden>; now we stream visibility from worksheet parts and adjust merges..xls/.xlsband ODS behave as before.visibilitymodule loads hidden axes per sheet by readingxl/workbook.xml,xl/_rels/workbook.xml.rels, and each worksheet XML with resource caps; if a part can’t be read within limits, we warn and leave that sheet unfiltered.Written for commit b6fe9a5. Summary will update on new commits.