From af999df6aefbb57c98c6cc42881bb5264e7a1f46 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 25 Jul 2014 16:15:47 +0000 Subject: Begin required interface + base-class support for multi-sheet area references for #55906 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613460 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/ss/formula/LazyAreaEval.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/java/org/apache/poi/ss/formula/LazyAreaEval.java') diff --git a/src/java/org/apache/poi/ss/formula/LazyAreaEval.java b/src/java/org/apache/poi/ss/formula/LazyAreaEval.java index 9791641a9d..0ac65a758b 100644 --- a/src/java/org/apache/poi/ss/formula/LazyAreaEval.java +++ b/src/java/org/apache/poi/ss/formula/LazyAreaEval.java @@ -25,30 +25,30 @@ import org.apache.poi.ss.formula.ptg.AreaI.OffsetArea; import org.apache.poi.ss.util.CellReference; /** - * Provides Lazy Evaluation to a 3D Ranges - * - * TODO Provide access to multiple sheets where present + * Provides Lazy Evaluation to 3D Ranges */ final class LazyAreaEval extends AreaEvalBase { private final SheetRangeEvaluator _evaluator; LazyAreaEval(AreaI ptg, SheetRangeEvaluator evaluator) { - super(ptg); + super(ptg, evaluator); _evaluator = evaluator; } public LazyAreaEval(int firstRowIndex, int firstColumnIndex, int lastRowIndex, int lastColumnIndex, SheetRangeEvaluator evaluator) { - super(firstRowIndex, firstColumnIndex, lastRowIndex, lastColumnIndex); + super(evaluator, firstRowIndex, firstColumnIndex, lastRowIndex, lastColumnIndex); _evaluator = evaluator; } - public ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex) { - + public ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex) { + return getRelativeValue(getFirstSheetIndex(), relativeRowIndex, relativeColumnIndex); + } + public ValueEval getRelativeValue(int sheetIndex, int relativeRowIndex, int relativeColumnIndex) { int rowIx = (relativeRowIndex + getFirstRow() ) ; int colIx = (relativeColumnIndex + getFirstColumn() ) ; - return _evaluator.getEvalForCell(_evaluator.getFirstSheetIndex(), rowIx, colIx); + return _evaluator.getEvalForCell(sheetIndex, rowIx, colIx); } public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) { -- cgit v1.2.3