From af69c811999d73e463daa38f4f15175c38b5e374 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Sun, 21 Nov 2010 11:52:32 +0000 Subject: [PATCH] moved common formula-related code to org.apache.poi.ss.formula, eliminated dependencies on HSSF, reduced the number of eclipse warnings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1037431 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/usermodel/XSSFCell.java | 5 ++--- .../poi/xssf/usermodel/XSSFFormulaEvaluator.java | 14 +++++++------- .../org/apache/poi/xssf/usermodel/XSSFSheet.java | 2 +- .../apache/poi/xssf/usermodel/XSSFWorkbook.java | 2 +- .../poi/xssf/usermodel/helpers/XSSFRowShifter.java | 2 +- .../xssf/usermodel/TestFormulaEvaluatorOnXSSF.java | 4 ++-- .../function/functionMetadata-asGenerated.txt | 0 .../formula/function/functionMetadata.txt | 0 8 files changed, 14 insertions(+), 15 deletions(-) rename src/resources/main/org/apache/poi/{hssf/record => ss}/formula/function/functionMetadata-asGenerated.txt (100%) rename src/resources/main/org/apache/poi/{hssf/record => ss}/formula/function/functionMetadata.txt (100%) diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java index 769d201321..cb0a4b27e5 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java @@ -22,10 +22,9 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; -import org.apache.poi.hssf.record.SharedFormulaRecord; import org.apache.poi.hssf.record.formula.Ptg; -import org.apache.poi.hssf.record.formula.SharedFormula; -import org.apache.poi.hssf.record.formula.eval.ErrorEval; +import org.apache.poi.ss.formula.SharedFormula; +import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.formula.FormulaParser; import org.apache.poi.ss.formula.FormulaRenderer; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java index f6f89967d0..6d2583b90d 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java @@ -19,12 +19,12 @@ package org.apache.poi.xssf.usermodel; import java.util.Iterator; -import org.apache.poi.hssf.record.formula.eval.BoolEval; -import org.apache.poi.hssf.record.formula.eval.ErrorEval; -import org.apache.poi.hssf.record.formula.eval.NumberEval; -import org.apache.poi.hssf.record.formula.eval.StringEval; -import org.apache.poi.hssf.record.formula.eval.ValueEval; -import org.apache.poi.hssf.record.formula.udf.UDFFinder; +import org.apache.poi.ss.formula.eval.BoolEval; +import org.apache.poi.ss.formula.eval.ErrorEval; +import org.apache.poi.ss.formula.eval.NumberEval; +import org.apache.poi.ss.formula.eval.StringEval; +import org.apache.poi.ss.formula.eval.ValueEval; +import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.formula.IStabilityClassifier; import org.apache.poi.ss.formula.WorkbookEvaluator; import org.apache.poi.ss.usermodel.Cell; @@ -54,7 +54,7 @@ public class XSSFFormulaEvaluator implements FormulaEvaluator { * @param stabilityClassifier used to optimise caching performance. Pass null * for the (conservative) assumption that any cell may have its definition changed after * evaluation begins. - * @deprecated (Sep 2009) (reduce overloading) use {@link #create(XSSFWorkbook, org.apache.poi.ss.formula.IStabilityClassifier, org.apache.poi.hssf.record.formula.udf.UDFFinder)} + * @deprecated (Sep 2009) (reduce overloading) use {@link #create(XSSFWorkbook, org.apache.poi.ss.formula.IStabilityClassifier, org.apache.poi.ss.formula.udf.UDFFinder)} */ @Deprecated public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 8f01127424..1e887ff011 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -33,7 +33,7 @@ import javax.xml.namespace.QName; import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.POIXMLException; import org.apache.poi.hssf.record.PasswordRecord; -import org.apache.poi.hssf.record.formula.FormulaShifter; +import org.apache.poi.ss.formula.FormulaShifter; import org.apache.poi.hssf.util.PaneInformation; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.PackagePart; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index c7fab8dc43..a559919e7e 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -37,7 +37,7 @@ import org.apache.poi.POIXMLDocument; import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.POIXMLException; import org.apache.poi.POIXMLProperties; -import org.apache.poi.hssf.record.formula.SheetNameFormatter; +import org.apache.poi.ss.formula.SheetNameFormatter; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java index 9facfe8f28..682ba9c1f9 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFRowShifter.java @@ -24,7 +24,7 @@ import org.apache.poi.ss.formula.FormulaType; import org.apache.poi.ss.formula.FormulaRenderer; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.hssf.record.formula.FormulaShifter; +import org.apache.poi.ss.formula.FormulaShifter; import org.apache.poi.hssf.record.formula.Ptg; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula; diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java index b6182cb418..c8808c96f3 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java @@ -25,8 +25,8 @@ import junit.framework.AssertionFailedError; import junit.framework.TestCase; import org.apache.poi.hssf.HSSFTestDataSamples; -import org.apache.poi.hssf.record.formula.eval.TestFormulasFromSpreadsheet; -import org.apache.poi.hssf.record.formula.functions.TestMathX; +import org.apache.poi.ss.formula.eval.TestFormulasFromSpreadsheet; +import org.apache.poi.ss.formula.functions.TestMathX; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellValue; import org.apache.poi.ss.usermodel.FormulaEvaluator; diff --git a/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata-asGenerated.txt b/src/resources/main/org/apache/poi/ss/formula/function/functionMetadata-asGenerated.txt similarity index 100% rename from src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata-asGenerated.txt rename to src/resources/main/org/apache/poi/ss/formula/function/functionMetadata-asGenerated.txt diff --git a/src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata.txt b/src/resources/main/org/apache/poi/ss/formula/function/functionMetadata.txt similarity index 100% rename from src/resources/main/org/apache/poi/hssf/record/formula/function/functionMetadata.txt rename to src/resources/main/org/apache/poi/ss/formula/function/functionMetadata.txt -- 2.39.5