Skip to content

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant