poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 53101] FormulaEvaluator incorrectly evaluates sum over cell range > 255
Date Wed, 18 Apr 2012 17:04:21 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53101

--- Comment #2 from malquitob@gmail.com 2012-04-18 17:04:21 UTC ---
I have a fix for this. I've modified pgetRelativeValue(..) in LazyAreaEval as
follows:

public ValueEval getRelativeValue(int relativeRowIndex, int
relativeColumnIndex) {

  int rowIx = (relativeRowIndex + getFirstRow() ) & 0xFFFF;
  int colIx = (relativeColumnIndex + getFirstColumn() ) & 0x3FFF;

  return _evaluator.getEvalForCell(rowIx, colIx);
}

The existing code contains:

int colIx = (relativeColumnIndex + getFirstColumn() ) & 0x00FF;

which assigns 0 to colIx if relativeColumnIndex + getFirstColumn() > 255, thus
cell numbers > 255 are not evaluated.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


Mime
View raw message