diff options
author | Josh Micich <josh@apache.org> | 2008-09-23 21:52:49 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2008-09-23 21:52:49 +0000 |
commit | 57f8cb379daa50ebf6723f2ebf5309202ea71bb2 (patch) | |
tree | 93eb745c9300909e527bee02d041b09dcbd7d85d /src/ooxml/java/org | |
parent | 08b87dee0feb93c4ad711303fa643e207c0e72f7 (diff) | |
download | poi-57f8cb379daa50ebf6723f2ebf5309202ea71bb2.tar.gz poi-57f8cb379daa50ebf6723f2ebf5309202ea71bb2.zip |
Merged revisions 698047 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r698047 | josh | 2008-09-22 17:40:22 -0700 (Mon, 22 Sep 2008) | 1 line
Optimised the FormulaEvaluator to take cell dependencies into account
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@698370 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java | 18 | ||||
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java | 22 |
2 files changed, 17 insertions, 23 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java index 2d442e8f4a..7c03ebe7ff 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java @@ -37,10 +37,16 @@ public final class XSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E return externSheetIndex;
}
/**
- * @returns the external sheet index of the sheet with the given internal
- * index, creating one if needed. Used by some of the more obscure
- * formula and named range things. Fairly easy on XSSF (we
- * think...) since the internal and external indicies are the same
+ * @return the sheet index of the sheet with the given external index.
+ */
+ public int convertFromExternSheetIndex(int externSheetIndex) {
+ return externSheetIndex;
+ }
+ /**
+ * @return the external sheet index of the sheet with the given internal
+ * index. Used by some of the more obscure formula and named range things.
+ * Fairly easy on XSSF (we think...) since the internal and external
+ * indicies are the same
*/
private int convertToExternalSheetIndex(int sheetIndex) {
return sheetIndex;
@@ -73,10 +79,6 @@ public final class XSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E return _uBook.getSheetName(sheetIndex);
}
- public int getNameIndex(String name) {
- return _uBook.getNameIndex(name);
- }
-
public NameXPtg getNameXPtg(String name) {
// may require to return null to make tests pass
throw new RuntimeException("Not implemented yet");
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java index 3dcedf8f5e..10fb78caf7 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java @@ -19,12 +19,14 @@ package org.apache.poi.xssf.usermodel; import java.util.Iterator;
+import org.apache.poi.hssf.record.formula.eval.BlankEval;
import org.apache.poi.hssf.record.formula.eval.BoolEval;
import org.apache.poi.hssf.record.formula.eval.ErrorEval;
import org.apache.poi.hssf.record.formula.eval.NumberEval;
import org.apache.poi.hssf.record.formula.eval.StringEval;
import org.apache.poi.hssf.record.formula.eval.ValueEval;
import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellValue;
@@ -51,14 +53,6 @@ public class XSSFFormulaEvaluator implements FormulaEvaluator { }
/**
- * TODO for debug/test use
- */
- /* package */ int getEvaluationCount() {
- return _bookEvaluator.getEvaluationCount();
- }
-
-
- /**
* Should be called whenever there are major changes (e.g. moving sheets) to input cells
* in the evaluated workbook.
* Failure to call this method after changing cell values will cause incorrect behaviour
@@ -67,13 +61,11 @@ public class XSSFFormulaEvaluator implements FormulaEvaluator { public void clearAllCachedResultValues() {
_bookEvaluator.clearAllCachedResultValues();
}
- /**
- * Should be called whenever there are changes to individual input cells in the evaluated workbook.
- * Failure to call this method after changing cell values will cause incorrect behaviour
- * of the evaluate~ methods of this class
- */
- public void clearCachedResultValue(Sheet sheet, int rowIndex, int columnIndex) {
- _bookEvaluator.clearCachedResultValue(sheet, rowIndex, columnIndex);
+ public void setCachedPlainValue(Sheet sheet, int rowIndex, int columnIndex, ValueEval value) {
+ _bookEvaluator.setCachedPlainValue(sheet, rowIndex, columnIndex, value);
+ }
+ public void notifySetFormula(HSSFSheet sheet, int rowIndex, int columnIndex) {
+ _bookEvaluator.notifySetFormula(sheet, rowIndex, columnIndex);
}
/**
|