Repository navigation
Keep chart cache point positions when a reference has blank edges (#1015) - #1103
Merged
Merged
Conversation
MarekSpodBiedry
marked this pull request as ready for review
October 13, 2026 16:10
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.
Fixes #1015.
ref_valuesincrates/xlsx/src/chart.rsintersected every chart reference with the sheet's used range, though its comment said this was only for whole columns/rows. The num/str cache writers then numbered the shortened list from 0 while keeping the original<c:f>. So forData!$A$3:$A$6with only A4 filled, the cache held one point atidx="0"andptCount="1", where it should holdidx="1"andptCount="4". Leading blanks moved later values to lower indices, and trailing blanks made the point count smaller. Category, X and Y ranges filled to different extents fell out of line with each other.The change:
$A:$A) and whole-row references still stop at the used range so the cache stays bounded. Only the far end is cut. The start stays at row 1 or column A, so indices still match the reference.MAX_CACHElimit is unchanged.chartex.rscalls the sameref_values, so the chartex point lists get the same fix.Tests (
crates/xlsx/src/tests/chart_ref_offsets.rs), both fail on main:explicit_range_keeps_leading_and_trailing_blanks:A3:A6with only A4 set gives[Empty, 5, Empty, Empty]. Main gives[5].whole_column_still_stops_at_used_range_and_starts_at_top:$A:$Agives four points that end at the last used row and start at row 1. Main gives[5].