Add recalc to xlsxC.getValueFrom()
#1823
Draft
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.
PR Details
Adds a
maybeRecalc()
method to address the issue mentioned discussion #1822.Description
Adds a
maybeRecalc()
method toxlsxc
to be called immediately after entering thegetFromValue()
method.This calls
File.CalcCellValue()
whenxlsxc.F != nil
andxlsxc.R != ""
andxlsxc.V
not one of""
,0
, or0.0
.This is a draft PR with many TODOs that bring up questions I had about if I was doing this the best way. I also ask questions to ensure I am using the right internal features and if I am following the vision of the project.
NOTE, when I was about to submit this I read the checklist and then went through the very thorough contributing guidelines.
Alas, I realizes there are many things I did not do — and since I am already running bind on my other deadlines I don't have time to do them all right now.
So I could have chosen either to not submit this as a draft PR — as I wrote it to solve my own current issues — or submit it so that it could be reviewed in connection with the referenced discussion and possibly updated to turn into a non-draft PR that could be merged later.
I chose the latter. I hope that you agree with me that I made the right choice.
Related Issue
Discussion #1822.
Motivation and Context
Ensures that zero values are not returned for sheets where there is a formula and a zero value, and while Excel shows a value excelize otherwise returns a zero value because of what is in the
<v>
element.This issue surfaces when calling
File.GetRows()
, and maybe other methods.I wrote this fix to meet my own needs, and am submitting it as a draft PR rather than just keeping it to myself.
How Has This Been Tested
I have only done manual testing as it is only a draft PR meant to spur discussion.
Types of changes
Checklist