Fixed handling of string based formulas. (#153)#154
Merged
monitorjbl merged 1 commit intomonitorjbl:masterfrom Oct 4, 2018
Merged
Fixed handling of string based formulas. (#153)#154monitorjbl merged 1 commit intomonitorjbl:masterfrom
monitorjbl merged 1 commit intomonitorjbl:masterfrom
Conversation
Fixed getting the wrong celltype for cached celltypes, when result is a
string, by saving the formula type as a boolean flag in the
StreamingCell and handling formula strings("t=str") as a normal string.
Owner
|
Sorry it's taken me so long to review this, I had kind of a crazy summer and haven't had any time for my GitHub projects (or much of anything else, really). Would it be alright if this change waited until the update to POI 4.0.0 goes through? It looks like @pjfanning already has applied this to his fork post-upgrade, so merging it now would cause a few merge conflicts. |
Contributor
|
@monitorjbl this is not mixed in with my pull request to your project - I have a fork of my own that I'm maintaining independently (for now) - so it's safe for you to merge this |
Merged
Contributor
|
Thanks a lot for merging. This was a major blocker for us! |
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.
The celltype
strused to be handled as if it has the celltypeCellType.FORMULA. Even if it only occurs as a result of a formula, it should still be handled as a string.This bug is fixed by using a boolean flag in the
StreamingCell.java, that is true when the element is found in the excel file.Using the method
getCellTypeEnum()now returnsCellType.STRINGforstras well. It now also checks if the the cell has the formulaType and will returnCellType.FORMULAif the boolean flag is true.The method
getCachedFormulaResultTypeEnum()will only return a cellType if the boolean flag is true and will also return CellType.String forstr.Included is a unittest covering the bug.
Let me know if you need any more information, of if I should change something in the code.