From 10e2804058a04acc8028c6d06f0fd5dbd179fbae Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Fri, 19 Sep 2008 07:59:40 +0000 Subject: [PATCH] formula improvements from josh git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@696969 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/formula/FormulaRenderer.java | 24 ++++++++++++++++++ .../ss/formula/FormulaRenderingWorkbook.java | 24 ++++++++++++++++++ .../ss/formula/WorkbookDependentFormula.java | 25 +++++++++++++++++++ 3 files changed, 73 insertions(+) diff --git a/src/java/org/apache/poi/ss/formula/FormulaRenderer.java b/src/java/org/apache/poi/ss/formula/FormulaRenderer.java index 21386cd0dd..980c345d39 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaRenderer.java +++ b/src/java/org/apache/poi/ss/formula/FormulaRenderer.java @@ -1,3 +1,20 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + package org.apache.poi.ss.formula; import java.util.List; @@ -11,6 +28,13 @@ import org.apache.poi.hssf.record.formula.OperationPtg; import org.apache.poi.hssf.record.formula.ParenthesisPtg; import org.apache.poi.hssf.record.formula.Ptg; +/** + * Common logic for rendering formulas.
+ * + * For POI internal use only + * + * @author Josh Micich + */ public class FormulaRenderer { /** * Convenience method which takes in a list then passes it to the diff --git a/src/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java b/src/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java index 3a92aa8cbc..ac95f4da0f 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java +++ b/src/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java @@ -1,8 +1,32 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + package org.apache.poi.ss.formula; import org.apache.poi.hssf.record.formula.NamePtg; import org.apache.poi.hssf.record.formula.NameXPtg; +/** + * Abstracts a workbook for the purpose of converting formula to text.
+ * + * For POI internal use only + * + * @author Josh Micich + */ public interface FormulaRenderingWorkbook { String getSheetNameByExternSheet(int externSheetIndex); diff --git a/src/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java b/src/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java index 420527dd81..b7ccfaf0eb 100644 --- a/src/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java +++ b/src/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java @@ -1,5 +1,30 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + package org.apache.poi.ss.formula; +/** + * Should be implemented by any {@link Ptg} subclass that needs a workbook to render its formula. + *
+ * + * For POI internal use only + * + * @author Josh Micich + */ public interface WorkbookDependentFormula { String toFormulaString(FormulaRenderingWorkbook book); }