Skip to content

Fix: add case-insensitive enum parsing to Chart Axis TickMark getters#2370

Merged
JanKallman merged 1 commit into
EPPlusSoftware:develop8from
lievendf:fix/chart-axis-tickmark-case-sensitivity
Jun 3, 2026
Merged

Fix: add case-insensitive enum parsing to Chart Axis TickMark getters#2370
JanKallman merged 1 commit into
EPPlusSoftware:develop8from
lievendf:fix/chart-axis-tickmark-case-sensitivity

Conversation

@lievendf
Copy link
Copy Markdown
Contributor

@lievendf lievendf commented Jun 2, 2026

Summary of Changes

This PR resolves a case-sensitivity enum parsing bug inside ExcelChartAxisStandard where setting MajorTickMark or MinorTickMark wrote lowercased strings to XML (e.g. "in", "out"), but reading them back failed because Enum.Parse was called case-sensitively against the capitalized enum members (In, Out).

Passing true as the third parameter of Enum.Parse enables case-insensitive parsing, bringing MajorTickMark and MinorTickMark into alignment with other chart axis properties.

Related Issues

Closes #2369

Details of Changes

  • src/EPPlus/Drawing/Chart/ExcelChartAxisStandard.cs:

    • Updated MajorTickMark getter to use Enum.Parse(typeof(eAxisTickMark), v, true).
    • Updated MinorTickMark getter to use Enum.Parse(typeof(eAxisTickMark), v, true).
  • src/EPPlusTest/Issues/ChartIssues.cs:

    • Added MSUnit test case ChartAxisTickMarkCaseSensitivity to verify that both MajorTickMark and MinorTickMark can be assigned and read back correctly for all valid enum states (In, Out, None).

Verification & Testing

  • Ran dotnet test src/EPPlusTest/EPPlus.Test.csproj --filter Name=ChartAxisTickMarkCaseSensitivity
  • Verified successful execution under .NET 8.0 and .NET Framework 4.8.1 (total: 2; failed: 0; succeeded: 2).

@JanKallman JanKallman merged commit 67759b1 into EPPlusSoftware:develop8 Jun 3, 2026
3 checks passed
@JanKallman
Copy link
Copy Markdown
Contributor

Thanks!

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.

Case-Sensitivity Enum Parsing Bug in ExcelChartAxisStandard MajorTickMark and MinorTickMark

3 participants