https://issues.apache.org/bugzilla/show_bug.cgi?id=55843

--- Comment #1 from Alessandro Guarascio <[email protected]> ---
This problem occurs also with POI 3.10. Generally speaking, I've noticed that
none of ROW() or COLUMN() functions work fine if used as THIRD argument of an
IF() function.

Examples are:
IF(FALSE,0,ROW()) returns FALSE instead of <row number>
IF(FALSE,0,-ROW()) returns 0.0 instead of -<row number>

Same behavior with COLUMN() Function.
If other functions (SUM(), NOW(), etc..) are used, it works as expected
If these fumctions are used as SECOND argument (TRUE branch) it works as
expected.

Debugging POI code I've noticed the following "strange" if statement, which, in
my opinion is the cause of the wrong behavior:

WorkbookEvaluator line 479 (POI 3.10)
if (ptgs[i] instanceof AttrPtg && nextPtg instanceof FuncVarPtg) {
    // this is an if statement without a false param [...]
    i++;                               
    stack.push(BoolEval.FALSE);
}
When processing IF function, nextPtg IS the ROW() function and this code makes
it always return FALSE (or 0.0).

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

Reply via email to