Skip to content

Fix shared formula expansion for whole-row and whole-column references - #350

Open
JunWang-Lin wants to merge 2 commits into
MathNya:masterfrom
JunWang-Lin:fix/shared-formula-whole-row-column-refs
Open

Fix shared formula expansion for whole-row and whole-column references#350
JunWang-Lin wants to merge 2 commits into
MathNya:masterfrom
JunWang-Lin:fix/shared-formula-whole-row-column-refs

Conversation

@JunWang-Lin

Copy link
Copy Markdown

Closes #349.

Summary

  • avoid panicking while expanding shared formulas that contain whole-column or whole-row references
  • adjust whole-column references only along the column axis and whole-row references only along the row axis
  • preserve absolute row/column locks and named ranges
  • produce #REF! when an adjusted reference moves out of bounds
  • add regression tests for cell, whole-column, and whole-row references

Root cause

Shared-formula expansion assumed every parsed reference had both a row and a column coordinate. Valid formulas such as VLOOKUP(G3,A:B,2,FALSE) contain a whole-column reference with no row coordinate, so the expansion path unwrapped None and panicked.

Validation

  • cargo +nightly fmt
  • cargo clippy --lib -- -D warnings
  • cargo test (299 passed, 23 ignored)
  • verified the original workbook formula IF(G3="","",VLOOKUP(G3,A:B,2,FALSE))

Note

The second commit restores a missing } in the existing number_formater test module on the current upstream master; without it, the repository cannot be formatted or compiled for validation.

@JunWang-Lin
JunWang-Lin marked this pull request as ready for review July 25, 2026 00:01
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.

Panic when expanding shared formulas with whole-column references

1 participant