Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix delete and add chart throws exception #990

Conversation

artem-iron
Copy link
Contributor

When new chart was created it's number was determined by the number of previously existing charts. This created a bug, when there were charts chart1.xml and chart2.xml, chart1 was deleted and the new chart was created. Since there is a chart already (chart2), the number for a new chart would be 2 (CountOfCharts + 1). This will throw an exception, because chart2.xml already exists.

Also added a RemoveChart method to XSSFDrawing and tests for the fixed bug and for the the RemoveChart method

Artem Koloskov added 4 commits December 29, 2022 11:13
The method checks for existing chat names, and gets the firtst chart number that isnt in use yet.
For ease of chart removal.
Improve TestRemoveOneOfTwoChartsAndAddNewOne test.
@tonyqus
Copy link
Member

tonyqus commented Jan 24, 2023

LGTM

@tonyqus tonyqus merged commit e428654 into nissl-lab:master Jan 24, 2023
@tonyqus tonyqus added this to the NPOI 2.6.1 milestone Jan 24, 2023
@artem-iron artem-iron deleted the fix-delete-and-add-chart-throws-exception branch January 26, 2023 03:03
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.

None yet

2 participants