aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2009-09-16 19:59:39 +0000
committerYegor Kozlov <yegor@apache.org>2009-09-16 19:59:39 +0000
commit513f87c21312c387c23e9a96a260739d0def2903 (patch)
tree72feb87306c6ce4d55be985d83fa2072ef2e1965 /src/java
parentd00286e166d221ad6298bdb775a1c479424fdbe9 (diff)
downloadpoi-513f87c21312c387c23e9a96a260739d0def2903.tar.gz
poi-513f87c21312c387c23e9a96a260739d0def2903.zip
Added possibility to get EvaluationCell from RefEval, see bugzilla 47849
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@815942 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java9
-rw-r--r--src/java/org/apache/poi/ss/formula/LazyRefEval.java4
-rw-r--r--src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java13
3 files changed, 26 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java b/src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java
index 397d1f1c94..c2b4583254 100644
--- a/src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java
+++ b/src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java
@@ -17,6 +17,8 @@
package org.apache.poi.hssf.record.formula.eval;
+import org.apache.poi.ss.formula.EvaluationCell;
+
/**
* @author Amol S Deshmukh &lt; amolweb at ya hoo dot com &gt;
*
@@ -26,6 +28,8 @@ package org.apache.poi.hssf.record.formula.eval;
* 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 @@ public interface RefEval extends ValueEval {
* 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();
}
diff --git a/src/java/org/apache/poi/ss/formula/LazyRefEval.java b/src/java/org/apache/poi/ss/formula/LazyRefEval.java
index 2a97c67c48..3626bc0412 100644
--- a/src/java/org/apache/poi/ss/formula/LazyRefEval.java
+++ b/src/java/org/apache/poi/ss/formula/LazyRefEval.java
@@ -52,6 +52,10 @@ final class LazyRefEval extends RefEvalBase {
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(),
diff --git a/src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java b/src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java
index 97568cfec4..b3ff5e4d3e 100644
--- a/src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java
+++ b/src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java
@@ -22,6 +22,10 @@ import org.apache.poi.hssf.record.formula.eval.ValueEval;
*
*
* @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 @@ final class SheetRefEvaluator {
}
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);
+ }
}