You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/01/01 17:27:41 UTC

[Bug 62904] Simple Excel Array Formula Fails in POI

https://bz.apache.org/bugzilla/show_bug.cgi?id=62904

--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> ---
Created attachment 36356
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36356&action=edit
patch to fix evaluation of IF with array arguments

With the attached patch POI evaluates it right.

Summary of changes:
1. IF needs to implement ArrayFunction
2. moved RelationalOperationEval#evaluateArray into ArrayFunction. The logic to
transpose and evaluate matrix arguments is common for all array functions and
IFFunc is an example.
3. changed WorkbookEvaluator to evaluate and put the first argument on the
stack in array mode. As Gallon noted, the "lazy if" logic  evaluates the first
arg as a boolean scalar which further results in a wrong result. 

Unit tests are coming soon

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org