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/09/05 22:43:38 UTC

svn commit: r692541 - in /poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions: Index.java LookupUtils.java Vlookup.java

Author: josh
Date: Fri Sep  5 13:43:37 2008
New Revision: 692541

URL: http://svn.apache.org/viewvc?rev=692541&view=rev
Log:
reverted changes accidentally submitted with r692538

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Index.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/LookupUtils.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Vlookup.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Index.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Index.java?rev=692541&r1=692540&r2=692541&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Index.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Index.java Fri Sep  5 13:43:37 2008
@@ -90,19 +90,9 @@
 		}
 	}
 	
-	private static ValueEval getValueFromArea(AreaEval ae, int pRowIx, int pColumnIx) throws EvaluationException {
+	private static ValueEval getValueFromArea(AreaEval ae, int rowIx, int columnIx) throws EvaluationException {
 		int width = ae.getWidth();
 		int height = ae.getHeight();
-		int rowIx;
-		int columnIx;
-		if (ae.isRow() && pColumnIx == 0 && pRowIx > 0) {
-			// TODO - explore all these special cases
-			rowIx = 0;
-			columnIx = pRowIx;
-		} else {
-			rowIx = pRowIx;
-			columnIx = pColumnIx;
-		}
 		
 		// Slightly irregular logic for bounds checking errors
 		if (rowIx >= height || columnIx >= width) {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/LookupUtils.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/LookupUtils.java?rev=692541&r1=692540&r2=692541&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/LookupUtils.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/LookupUtils.java Fri Sep  5 13:43:37 2008
@@ -17,7 +17,6 @@
 
 package org.apache.poi.hssf.record.formula.functions;
 
-import org.apache.poi.hssf.record.NumberRecord;
 import org.apache.poi.hssf.record.formula.eval.AreaEval;
 import org.apache.poi.hssf.record.formula.eval.BlankEval;
 import org.apache.poi.hssf.record.formula.eval.BoolEval;
@@ -588,9 +587,7 @@
 
 		if (lookupValue instanceof BlankEval) {
 			// blank eval can never be found in a lookup array
-			//throw new EvaluationException(ErrorEval.NA);
-			// TODO - investigate this
-			return new NumberLookupComparer(NumberEval.ZERO);
+			throw new EvaluationException(ErrorEval.NA);
 		}
 		if (lookupValue instanceof StringEval) {
 			return new StringLookupComparer((StringEval) lookupValue);

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Vlookup.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Vlookup.java?rev=692541&r1=692540&r2=692541&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Vlookup.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/functions/Vlookup.java Fri Sep  5 13:43:37 2008
@@ -60,16 +60,7 @@
 			AreaEval tableArray = LookupUtils.resolveTableArrayArg(args[1]);
 			boolean isRangeLookup = LookupUtils.resolveRangeLookupArg(arg3, srcCellRow, srcCellCol);
 			int rowIndex = LookupUtils.lookupIndexOfValue(lookupValue, LookupUtils.createColumnVector(tableArray, 0), isRangeLookup);
-			ValueEval veColIndex;
-			try {
-				veColIndex = OperandResolver.getSingleValue(args[2], srcCellRow, srcCellCol);
-			} catch (EvaluationException e) {
-				// weird translation of errors for the third arg - needs investigation
-				if (e.getErrorEval() == ErrorEval.NA) {
-					return ErrorEval.REF_INVALID;
-				}
-				throw e;
-			}
+			ValueEval veColIndex = OperandResolver.getSingleValue(args[2], srcCellRow, srcCellCol);
 			int colIndex = LookupUtils.resolveRowOrColIndexArg(veColIndex);
 			ValueVector resultCol = createResultColumnVector(tableArray, colIndex);
 			return resultCol.getItem(rowIndex);



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