You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by jo...@apache.org on 2008/10/09 08:46:19 UTC

svn commit: r703070 [2/2] - in /poi/branches/ooxml: ./ src/documentation/content/xdocs/ src/java/org/apache/poi/hssf/record/ src/java/org/apache/poi/hssf/record/formula/eval/ src/java/org/apache/poi/hssf/record/formula/functions/ src/java/org/apache/po...

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/UnitsRecord.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/UnitsRecord.java?rev=703070&r1=703069&r2=703070&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/UnitsRecord.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/UnitsRecord.java Wed Oct  8 23:46:17 2008
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,24 +14,18 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.LittleEndian;
 
 /**
- * The units record describes units.
- * NOTE: This source is automatically generated please do not modify this file.  Either subclass or
- *       remove the record in src/records/definitions.
-
+ * The units record describes units.<p/>
+ * 
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public class UnitsRecord
-    extends Record
-{
+public final class UnitsRecord extends Record {
     public final static short      sid                             = 0x1001;
     private  short      field_1_units;
 
@@ -74,9 +67,6 @@
         return getRecordSize();
     }
 
-    /**
-     * Size of record (exluding 4 byte header)
-     */
     public int getRecordSize()
     {
         return 4  + 2;
@@ -112,10 +102,4 @@
     {
         this.field_1_units = field_1_units;
     }
-
-
-}  // END OF CLASS
-
-
-
-
+}

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java?rev=703070&r1=703069&r2=703070&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java Wed Oct  8 23:46:17 2008
@@ -23,10 +23,8 @@
 import org.apache.poi.util.LittleEndian;
 
 /**
- * The value range record defines the range of the value axis.
- * NOTE: This source is automatically generated please do not modify this file.  Either subclass or
- *       remove the record in src/records/definitions.
-
+ * The value range record defines the range of the value axis.<p/>
+ * 
  * @author Glen Stampoultzis (glens at apache.org)
  */
 public final class ValueRangeRecord extends Record {
@@ -121,9 +119,6 @@
         return getRecordSize();
     }
 
-    /**
-     * Size of record (exluding 4 byte header)
-     */
     public int getRecordSize()
     {
         return 4  + 8 + 8 + 8 + 8 + 8 + 2;

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/functions/Count.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/functions/Count.java?rev=703070&r1=703069&r2=703070&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/functions/Count.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/functions/Count.java Wed Oct  8 23:46:17 2008
@@ -19,6 +19,7 @@
 
 import org.apache.poi.hssf.record.formula.eval.ErrorEval;
 import org.apache.poi.hssf.record.formula.eval.Eval;
+import org.apache.poi.hssf.record.formula.eval.MissingArgEval;
 import org.apache.poi.hssf.record.formula.eval.NumberEval;
 import org.apache.poi.hssf.record.formula.functions.CountUtils.I_MatchPredicate;
 
@@ -64,6 +65,10 @@
 				// only numbers are counted
 				return true;
 			}
+			if(valueEval == MissingArgEval.instance) {
+				// oh yeah, and missing arguments
+				return true;
+			}
 
 			// error values and string values not counted
 			return false;

Modified: poi/branches/ooxml/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java?rev=703070&r1=703069&r2=703070&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java Wed Oct  8 23:46:17 2008
@@ -52,6 +52,7 @@
 import org.apache.poi.hssf.record.formula.eval.ErrorEval;
 import org.apache.poi.hssf.record.formula.eval.Eval;
 import org.apache.poi.hssf.record.formula.eval.FunctionEval;
+import org.apache.poi.hssf.record.formula.eval.MissingArgEval;
 import org.apache.poi.hssf.record.formula.eval.NameEval;
 import org.apache.poi.hssf.record.formula.eval.NameXEval;
 import org.apache.poi.hssf.record.formula.eval.NumberEval;
@@ -284,10 +285,7 @@
 				continue;
 			}
 			if (ptg instanceof MemErrPtg) { continue; }
-			if (ptg instanceof MissingArgPtg) {
-				// TODO - might need to push BlankEval or MissingArgEval
-				continue;
-			}
+
 			Eval opResult;
 			if (ptg instanceof OperationPtg) {
 				OperationPtg optg = (OperationPtg) ptg;
@@ -306,6 +304,9 @@
 				}
 //				logDebug("invoke " + operation + " (nAgs=" + numops + ")");
 				opResult = invokeOperation(operation, ops, _workbook, sheetIndex, srcRowNum, srcColNum);
+				if (opResult == MissingArgEval.instance) {
+					opResult = BlankEval.INSTANCE;
+				}
 			} else {
 				opResult = getEvalForPtg(ptg, sheetIndex, tracker);
 			}
@@ -424,6 +425,9 @@
 		if (ptg instanceof ErrPtg) {
 			return ErrorEval.valueOf(((ErrPtg) ptg).getErrorCode());
 		}
+		if (ptg instanceof MissingArgPtg) {
+			return MissingArgEval.instance;
+		}
 		if (ptg instanceof AreaErrPtg ||ptg instanceof RefErrorPtg 
 				|| ptg instanceof DeletedArea3DPtg || ptg instanceof DeletedRef3DPtg) {
 				return ErrorEval.REF_INVALID;

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/AllFormulaEvalTests.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/AllFormulaEvalTests.java?rev=703070&r1=703069&r2=703070&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/AllFormulaEvalTests.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/AllFormulaEvalTests.java Wed Oct  8 23:46:17 2008
@@ -36,6 +36,7 @@
 		result.addTestSuite(TestExternalFunction.class);
 		result.addTestSuite(TestFormulaBugs.class);
 		result.addTestSuite(TestFormulasFromSpreadsheet.class);
+		result.addTestSuite(TestMissingArgEval.class);
 		result.addTestSuite(TestPercentEval.class);
 		result.addTestSuite(TestRangeEval.class);
 		result.addTestSuite(TestUnaryPlusEval.class);

Copied: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/TestMissingArgEval.java (from r702231, poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestMissingArgEval.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/TestMissingArgEval.java?p2=poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/TestMissingArgEval.java&p1=poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestMissingArgEval.java&r1=702231&r2=703070&rev=703070&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestMissingArgEval.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/eval/TestMissingArgEval.java Wed Oct  8 23:46:17 2008
@@ -26,7 +26,7 @@
 import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue;
+import org.apache.poi.ss.usermodel.CellValue;
 
 /**
  * Tests for {@link MissingArgEval}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org