From cd7de7d482ec06e4c9ab8050935cbf12d452878b Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 25 Jul 2014 16:42:31 +0000 Subject: [PATCH] Complete evaluation support for multi-sheet references for bug #55906 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613467 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/formula/functions/CountUtils.java | 52 +++++++++++-------- .../poi/ss/formula/functions/Countblank.java | 6 +-- .../poi/ss/formula/functions/Countif.java | 6 +-- .../MultiOperandNumericFunction.java | 18 ++++++- .../usermodel/TestXSSFFormulaEvaluation.java | 8 ++- .../formula/atp/TestNetworkdaysFunction.java | 6 ++- .../ss/formula/atp/TestWorkdayFunction.java | 6 ++- .../poi/ss/formula/eval/TestRangeEval.java | 3 ++ .../poi/ss/formula/functions/EvalFactory.java | 3 ++ 9 files changed, 70 insertions(+), 38 deletions(-) diff --git a/src/java/org/apache/poi/ss/formula/functions/CountUtils.java b/src/java/org/apache/poi/ss/formula/functions/CountUtils.java index 6c5fbce7dc..270f787bc7 100644 --- a/src/java/org/apache/poi/ss/formula/functions/CountUtils.java +++ b/src/java/org/apache/poi/ss/formula/functions/CountUtils.java @@ -17,6 +17,7 @@ package org.apache.poi.ss.formula.functions; +import org.apache.poi.ss.formula.ThreeDEval; import org.apache.poi.ss.formula.TwoDEval; import org.apache.poi.ss.formula.eval.RefEval; import org.apache.poi.ss.formula.eval.ValueEval; @@ -42,30 +43,32 @@ final class CountUtils { boolean matches(TwoDEval x, int rowIndex, int columnIndex); } - /** - * @return the number of evaluated cells in the range that match the specified criteria - */ - public static int countMatchingCellsInArea(TwoDEval areaEval, I_MatchPredicate criteriaPredicate) { - int result = 0; - - int height = areaEval.getHeight(); - int width = areaEval.getWidth(); - for (int rrIx=0; rrIx=getHeight()) { throw new IllegalArgumentException("row index out of range"); } -- 2.39.5