[GitHub] [poi] RemboL opened a new pull request #191: Fix RuntimeException on array formula referencing blank cell

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [poi] RemboL opened a new pull request #191: Fix RuntimeException on array formula referencing blank cell

GitBox

RemboL opened a new pull request #191:
URL: https://github.com/apache/poi/pull/191


   I had an array formula that referenced range which contained blank cells - this caused exception, because method evaluateFormulaCellValue did not expect BlankEval. Interestingly enough, this does not happen in normal formulas (Blank cell evaluates to NumberEval[0]).
   
   I traced this behavior to WorkbookEvaluator::defererenceResult(ValueEval, OperationEvaluationContext) which branches, depending whether this is AreaEval or not. Part for non-AreaEval (method dereferenceResult(ValueEval,int,int) ) swaps BlankEval for NumberEval.ZERO and part for AreaEval does not.
   
   I checked in LibreOffice and expected behavior seems to be that ref to blank cell evalulates to zero (both in array and non-array formula), so I copied this logic to dereferenceResult(ValueEval, OperationEvaluationContext) - I wanted to move it completely, but method dereferenceResult(ValueEval,int,int) is public and used by other class, so removing this piece of code might influence its behavior.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] [poi] asfgit closed pull request #191: Fix RuntimeException on array formula referencing blank cell

GitBox

asfgit closed pull request #191:
URL: https://github.com/apache/poi/pull/191


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]