From 97693b3845cd815111351e8001328befbcbb0875 Mon Sep 17 00:00:00 2001 From: "Andrew C. Oliver" Date: Fri, 6 Sep 2002 03:56:47 +0000 Subject: [PATCH] *read only* support for optimized ifs. meaning "if(A1=A3,A1,A2)" and stuff. This optimized if has the conceptual clarity of a featherweight elephant carrier used as a pizza topping. This concludes my therapy session. I love this project :-). Next week I'll try and get write support underway unless someone beats me to it. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352839 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hssf/model/FormulaParser.java | 36 +++++++++++++++---- .../record/formula/AbstractFunctionPtg.java | 25 +++++++------ .../poi/hssf/record/formula/AttrPtg.java | 4 ++- .../poi/hssf/usermodel/TestFormulas.java | 16 +++++++-- 4 files changed, 57 insertions(+), 24 deletions(-) diff --git a/src/java/org/apache/poi/hssf/model/FormulaParser.java b/src/java/org/apache/poi/hssf/model/FormulaParser.java index 78bd113d42..b84aabbb75 100644 --- a/src/java/org/apache/poi/hssf/model/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/model/FormulaParser.java @@ -603,20 +603,42 @@ end; int numPtgs = ptgs.length; OperationPtg o; int numOperands; + String result=null; String[] operands; + AttrPtg ifptg = null; for (int i=0;i0) { o = (OperationPtg) ptgs[i]; - numOperands = o.getNumberOfOperands(); - operands = new String[numOperands]; - for (int j=0;j0) { for (int i=0;i