https://bz.apache.org/bugzilla/show_bug.cgi?id=62040
Bug ID: 62040
Summary: Quotient.evaluate function does not accept cell
refences
Product: POI
Version: 3.17-FINAL
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: SS Common
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
I think adding OperandResolver.getSingleValue for the numerator and denominator
might solvce the problem.
@Override
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex,
ValueEval venumerator, ValueEval vedenominator) {
double enumerator = 0;
try {
ValueEval ve =
OperandResolver.getSingleValue(venumerator, srcRowIndex, srcColumnIndex); //
added this line
enumerator = OperandResolver.coerceValueToDouble(ve);
} catch (EvaluationException e) {
return ErrorEval.VALUE_INVALID;
}
double denominator = 0;
try {
ValueEval ve =
OperandResolver.getSingleValue(vedenominator, srcRowIndex, srcColumnIndex); //
added this line
denominator = OperandResolver.coerceValueToDouble(ve);
} catch (EvaluationException e) {
return ErrorEval.VALUE_INVALID;
}
if (denominator == 0) {
return ErrorEval.DIV_ZERO;
}
return new NumberEval((int)(enumerator / denominator));
}
--
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]