Index: src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java =================================================================== --- src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java (revision 815654) +++ src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java (working copy) @@ -17,6 +17,8 @@ package org.apache.poi.hssf.record.formula.eval; +import org.apache.poi.ss.formula.EvaluationCell; + /** * @author Amol S Deshmukh < amolweb at ya hoo dot com > * @@ -26,6 +28,8 @@ * reference. Thus if the HSSFCell has type CELL_TYPE_NUMERIC, the contained * value object should be of type NumberEval; if cell type is CELL_TYPE_STRING, * contained value object should be of type StringEval + * + * Modified 09/07/09 by Petr Udalau - added method getEvaluationCell(). */ public interface RefEval extends ValueEval { @@ -48,4 +52,9 @@ * Creates an {@link AreaEval} offset by a relative amount from this RefEval */ AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx); + + /** + * @return EvaluationCell referred to by this RefEval + */ + EvaluationCell getEvaluationCell(); } Index: src/java/org/apache/poi/ss/formula/LazyRefEval.java =================================================================== --- src/java/org/apache/poi/ss/formula/LazyRefEval.java (revision 815654) +++ src/java/org/apache/poi/ss/formula/LazyRefEval.java (working copy) @@ -52,6 +52,10 @@ return _evaluator.getEvalForCell(getRow(), getColumn()); } + public EvaluationCell getEvaluationCell() { + return _evaluator.getEvaluationCell(getRow(), getColumn()); + } + public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) { AreaI area = new OffsetArea(getRow(), getColumn(), Index: src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java =================================================================== --- src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java (revision 815654) +++ src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java (working copy) @@ -22,6 +22,10 @@ * * * @author Josh Micich + * + * June 4, 2009: Added method setCellValue for setting values in cells. + * + * Modified 09/07/09 by Petr Udalau - added method getEvaluationCell(int rowIndex, int columnIndex). */ final class SheetRefEvaluator { @@ -53,4 +57,13 @@ } return _sheet; } + + /** + * @param rowIndex Row index. + * @param columnIndex Column index. + * @return EvaluationCell by row and column. + */ + public EvaluationCell getEvaluationCell(int rowIndex, int columnIndex){ + return getSheet().getCell(rowIndex, columnIndex); + } }