fix: preserve color selectors and avoid loaded-sheet style cloning - #365
Merged
Merged
Conversation
Owner
|
@PSU3D0 |
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.
Summary
NotFound/NotDeserializedsemantics.examples/loaded_sheet_access_probe.rs(it reports timings without assertions).src/reader/driver.rs.Motivation and behavior
Border::set_attributespreviously parsed into a discarded clone. Color hashes also lacked selector-kind separation (theme="1"versusindexed="1"), while border hashes omitted theme identity. The fixes preserve the serialized selector and tint rather than flattening colors to display RGB. Font, border, pattern-fill, and gradient-stop readers now accept both empty and expanded color elements.Explicit
set_argb/set_argb_strcalls now keep RGB identity even for palette colors. This intentionally changes callers' indexed-color introspection after setting RGB; callers that want an indexed selector can continue usingset_indexed. The additive automatic-color API preserves explicit true/false and clears a previous base selector when switching representations.Mutable access to an already loaded sheet previously cloned the stylesheet before discovering that deserialization was unnecessary. The fast path checks the sheet state first. It does not change cell storage, add unsafe code, or alter lazy deserialization of unloaded sheets.
The fidelity tests resolve worksheet cell/row/column references through
cellXfs, component IDs, and conditional-formatdxfId, then assert the exact raw XML attributes. They run ordinary and expanded XML cases with theme/indexed tint, palette RGB, automatic colors, pattern fills, and gradients. The five base-compatible tests fail on the base commit and pass here; the automatic-setter test exercises a new API.Validation
cargo testcargo clippy -- -D warningscargo +nightly fmt --all -- --checkcargo run --release --example loaded_sheet_access_probe -- 1000 1000The row-height-policy change and its associated test are intentionally not part of this PR.