View | Details | Raw Unified | Return to bug 58339
Collapse All | Expand All

(-)a/src/java/org/apache/poi/ss/formula/functions/Offset.java (-2 / +7 lines)
Lines 20-25 package org.apache.poi.ss.formula.functions; Link Here
20
import org.apache.poi.ss.formula.eval.AreaEval;
20
import org.apache.poi.ss.formula.eval.AreaEval;
21
import org.apache.poi.ss.formula.eval.ErrorEval;
21
import org.apache.poi.ss.formula.eval.ErrorEval;
22
import org.apache.poi.ss.formula.eval.EvaluationException;
22
import org.apache.poi.ss.formula.eval.EvaluationException;
23
import org.apache.poi.ss.formula.eval.MissingArgEval;
23
import org.apache.poi.ss.formula.eval.OperandResolver;
24
import org.apache.poi.ss.formula.eval.OperandResolver;
24
import org.apache.poi.ss.formula.eval.RefEval;
25
import org.apache.poi.ss.formula.eval.RefEval;
25
import org.apache.poi.ss.formula.eval.ValueEval;
26
import org.apache.poi.ss.formula.eval.ValueEval;
Lines 173-181 public final class Offset implements Function { Link Here
173
			int width = baseRef.getWidth();
174
			int width = baseRef.getWidth();
174
			switch(args.length) {
175
			switch(args.length) {
175
				case 5:
176
				case 5:
176
					width = evaluateIntArg(args[4], srcCellRow, srcCellCol);
177
					if(!(args[4] instanceof MissingArgEval)) {
178
						width = evaluateIntArg(args[4], srcCellRow, srcCellCol);
179
					}
177
				case 4:
180
				case 4:
178
					height = evaluateIntArg(args[3], srcCellRow, srcCellCol);
181
					if(!(args[3] instanceof MissingArgEval)) {
182
						height = evaluateIntArg(args[3], srcCellRow, srcCellCol);
183
					}
179
			}
184
			}
180
			// Zero height or width raises #REF! error
185
			// Zero height or width raises #REF! error
181
			if(height == 0 || width == 0) {
186
			if(height == 0 || width == 0) {

Return to bug 58339