]> source.dussan.org Git - poi.git/commitdiff
Added possibility to get EvaluationCell from RefEval, see bugzilla 47849
authorYegor Kozlov <yegor@apache.org>
Wed, 16 Sep 2009 19:59:39 +0000 (19:59 +0000)
committerYegor Kozlov <yegor@apache.org>
Wed, 16 Sep 2009 19:59:39 +0000 (19:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@815942 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/hssf/record/formula/eval/RefEval.java
src/java/org/apache/poi/ss/formula/LazyRefEval.java
src/java/org/apache/poi/ss/formula/SheetRefEvaluator.java

index 2e39f07ee3d50c41c0c6b08e4a5a057261c1534a..fcb0640b820304ad2b26ddb6781d034038a6feef 100644 (file)
@@ -32,7 +32,8 @@
     </developers>
 
     <changes>
-        <release version="3.5-beta7" date="2009-??-??">
+      <release version="3.5-beta7" date="2009-??-??">
+           <action dev="POI-DEVELOPERS" type="add">47849 - Added possibility to get EvaluationCell from RefEval</action>
            <action dev="POI-DEVELOPERS" type="add">47848 - Added method createEvaluationWorkbook() to CreationHelper</action>
            <action dev="POI-DEVELOPERS" type="add">47809 - Improved work with user-defined functions</action>
            <action dev="POI-DEVELOPERS" type="fix">47581 - fixed  XSSFSheet.setColumnWidth to produce XML compatible with Mac Excel 2008</action>
index 397d1f1c94160545afa86b5702b362e4a5b11b06..c2b4583254a741d929d0ebbc7e11658601772fd0 100644 (file)
@@ -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();
 }
index 2a97c67c4818dbe5e0b38a2ddd0e669d878d9973..3626bc041234134279231a4428a39fffe9240e40 100644 (file)
@@ -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(),
index 97568cfec4beb6f5bcf16f8855755b594d10cd31..b3ff5e4d3ea718e54050f3257f6b1f106194a3b2 100644 (file)
@@ -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);
+    }
 }