diff options
author | Nick Burch <nick@apache.org> | 2013-01-10 15:08:22 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2013-01-10 15:08:22 +0000 |
commit | f7b2d4047f2305917c20ef0537a9c3df4d1a4540 (patch) | |
tree | 929a2aab4538aecb418db865b8edd41638599aed /src/java | |
parent | 008dea947c46c8defba2ea63ce3f96743c499ec7 (diff) | |
download | poi-f7b2d4047f2305917c20ef0537a9c3df4d1a4540.tar.gz poi-f7b2d4047f2305917c20ef0537a9c3df4d1a4540.zip |
Patch from Johan from bug #54402 - fix IfError with indirect references
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1431403 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/ss/formula/atp/IfError.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/ss/formula/atp/IfError.java b/src/java/org/apache/poi/ss/formula/atp/IfError.java index 5b7e21b8d0..d3a22661b8 100644 --- a/src/java/org/apache/poi/ss/formula/atp/IfError.java +++ b/src/java/org/apache/poi/ss/formula/atp/IfError.java @@ -18,6 +18,7 @@ package org.apache.poi.ss.formula.atp; import org.apache.poi.ss.formula.OperationEvaluationContext; +import org.apache.poi.ss.formula.WorkbookEvaluator; import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.EvaluationException; import org.apache.poi.ss.formula.eval.ValueEval; @@ -47,7 +48,7 @@ final class IfError implements FreeRefFunction { ValueEval val; try { - val = evaluateArgParity(args[0], args[1], ec.getRowIndex(), ec.getColumnIndex()); + val = evaluateInternal(args[0], args[1], ec.getRowIndex(), ec.getColumnIndex()); } catch (EvaluationException e) { return e.getErrorEval(); } @@ -55,11 +56,12 @@ final class IfError implements FreeRefFunction { return val; } - private static ValueEval evaluateArgParity(ValueEval arg, ValueEval iferror, int srcCellRow, int srcCellCol) throws EvaluationException { + private static ValueEval evaluateInternal(ValueEval arg, ValueEval iferror, int srcCellRow, int srcCellCol) throws EvaluationException { + arg = WorkbookEvaluator.dereferenceResult(arg, srcCellRow, srcCellCol); if(arg instanceof ErrorEval) { return iferror; } else { return arg; } } -}
\ No newline at end of file +} |