Summary: | [PATCH] WorkdayFunction does not read correctly the area with holidays to calculate work days | ||
---|---|---|---|
Product: | POI | Reporter: | Artem Bondar <bondaraw> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | bondaraw |
Priority: | P2 | Keywords: | PatchAvailable |
Version: | 3.13-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
Excel file with data for testing and Unit test
Patch file Unit test Excel document with tests data |
Created attachment 33660 [details]
Patch file
Created attachment 33661 [details]
Unit test
Created attachment 33662 [details]
Excel document with tests data
|
Created attachment 33618 [details] Excel file with data for testing and Unit test Package: org.apache.poi.ss.formula.atp Class: ArgumentsEvaluator Method: evaluateDatesArg(ValueEval arg, int srcCellRow, int srcCellCol); Here is the code: for (int i = area.getFirstRow(); i <= area.getLastRow(); i++) { for (int j = area.getFirstColumn(); j <= area.getLastColumn(); j++) { valuesList.add(evaluateDateArg(area.getValue(i, j), i, j)); } } i and j stored absolute path. Method getValue() used relative path. Here is code: public final ValueEval getValue(int row, int col) { return getRelativeValue(row, col); } WorkdayFunction does not read correctly the area with holidays to calculate work days. We have debugged it and found that you are using a relating path (area.getValue()), but you need to use an absolute path (area.getAbsoluteValue()). An excel file with data for testing and Unit test is attached. Please fix it.