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 RuntimeException on array formula referencing blank cell #191

Closed
wants to merge 1 commit into from

Conversation

RemboL
Copy link

@RemboL RemboL commented Aug 14, 2020

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.

@asfgit asfgit closed this in 4e3008a Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant