Skip to content

#2431 Fix formula cfvo load error in ext icon sets#2432

Merged
JanKallman merged 1 commit into
develop8from
bug/i2431
Jul 13, 2026
Merged

#2431 Fix formula cfvo load error in ext icon sets#2432
JanKallman merged 1 commit into
develop8from
bug/i2431

Conversation

@swmal

@swmal swmal commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

See #2431.

Loading a workbook with an icon set conditional formatting rule stored in extLst threw an InvalidOperationException when a threshold used type="formula" with a numeric constant value.

Cause

Icon sets using extended sets (3Stars, 3Triangles, 5Boxes) or cross-sheet formulas are stored in extLst and read via ApplyIconSetExtValues. That reader routed any numeric value to the Value setter without checking the cfvo type, and the setter rejects Value when Type == Formula. The regular icon set reader (ReadIcon) and the databar reader already had this guard.

Fix

Added a Type != Formula check in ApplyIconSetExtValues so formula thresholds are routed to the Formula property, matching the other two readers. Also switched the numeric parse to InvariantCulture, consistent with the databar reader and correct for the invariant XML format.

Tests

Added round-trip tests that build an icon set in code, save to a stream, and reload:

  • Ext icon set (3Stars) with a numeric formula cfvo — reproduces the exception without the fix, passes with it.
  • Regular icon set — guards the ReadIcon path against regression.

Full conditional formatting regression suite passes.

@swmal swmal self-assigned this Jul 10, 2026
@JanKallman
JanKallman merged commit 4d40481 into develop8 Jul 13, 2026
3 checks passed
@JanKallman
JanKallman deleted the bug/i2431 branch July 13, 2026 07:39
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.

2 participants