You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2013/03/03 17:16:12 UTC

svn commit: r1452060 - in /poi/trunk/src: java/org/apache/poi/hssf/usermodel/ java/org/apache/poi/ss/formula/udf/ ooxml/java/org/apache/poi/xssf/model/ ooxml/java/org/apache/poi/xssf/usermodel/

Author: yegor
Date: Sun Mar  3 16:16:12 2013
New Revision: 1452060

URL: http://svn.apache.org/r1452060
Log:
Bugzilla 54625 - Register user-defined functions in instance scope instead of static

Added:
    poi/trunk/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java
      - copied, changed from r1451872, poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java
Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java?rev=1452060&r1=1452059&r2=1452060&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java Sun Mar  3 16:16:12 2013
@@ -57,6 +57,7 @@ import org.apache.poi.ss.util.WorkbookUt
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.poi.ss.formula.udf.IndexedUDFFinder;
 
 
 /**
@@ -145,7 +146,7 @@ public final class HSSFWorkbook extends 
      * The locator of user-defined functions.
      * By default includes functions from the Excel Analysis Toolpack
      */
-    private UDFFinder _udfFinder = UDFFinder.DEFAULT;
+    private UDFFinder _udfFinder = new IndexedUDFFinder(UDFFinder.DEFAULT);
 
     public static HSSFWorkbook create(InternalWorkbook book) {
     	return new HSSFWorkbook(book);

Copied: poi/trunk/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java (from r1451872, poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java?p2=poi/trunk/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java&p1=poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java&r1=1451872&r2=1452060&rev=1452060&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java Sun Mar  3 16:16:12 2013
@@ -14,11 +14,9 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.xssf.model;
+package org.apache.poi.ss.formula.udf;
 
 import org.apache.poi.ss.formula.functions.FreeRefFunction;
-import org.apache.poi.ss.formula.udf.AggregatingUDFFinder;
-import org.apache.poi.ss.formula.udf.UDFFinder;
 import org.apache.poi.util.Internal;
 
 import java.util.HashMap;
@@ -29,7 +27,7 @@ import java.util.HashMap;
  * @author Yegor Kozlov
  */
 @Internal
-public final class IndexedUDFFinder extends AggregatingUDFFinder {
+public class IndexedUDFFinder extends AggregatingUDFFinder {
     private final HashMap<Integer, String> _funcMap;
 
     public IndexedUDFFinder(UDFFinder... usedToolPacks) {

Added: poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java?rev=1452060&view=auto
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java (added)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/IndexedUDFFinder.java Sun Mar  3 16:16:12 2013
@@ -0,0 +1,37 @@
+/*
+ *  ====================================================================
+ *    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.xssf.model;
+
+import org.apache.poi.ss.formula.udf.UDFFinder;
+
+
+/**
+ * IndexedUDFFinder was moved to the org.apache.poi.ss.formula.udf package.
+ * This class is left ONLY for backwards compatibity with existing code.
+ *
+ * @author Yegor Kozlov
+ * @deprecated
+ */
+@Deprecated
+public final class IndexedUDFFinder extends org.apache.poi.ss.formula.udf.IndexedUDFFinder{
+    public IndexedUDFFinder(UDFFinder... usedToolPacks) {
+        super(usedToolPacks);
+    }
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java?rev=1452060&r1=1452059&r2=1452060&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java Sun Mar  3 16:16:12 2013
@@ -31,7 +31,7 @@ import org.apache.poi.ss.formula.Formula
 import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
 import org.apache.poi.ss.formula.FormulaType;
 import org.apache.poi.ss.formula.udf.UDFFinder;
-import org.apache.poi.xssf.model.IndexedUDFFinder;
+import org.apache.poi.ss.formula.udf.IndexedUDFFinder;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName;
 
 /**

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java?rev=1452060&r1=1452059&r2=1452060&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java Sun Mar  3 16:16:12 2013
@@ -41,6 +41,7 @@ import org.apache.poi.openxml4j.opc.Pack
 import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
 import org.apache.poi.openxml4j.opc.PackagingURIHelper;
 import org.apache.poi.openxml4j.opc.TargetMode;
+import org.apache.poi.ss.formula.udf.IndexedUDFFinder;
 import org.apache.poi.ss.formula.udf.UDFFinder;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -50,7 +51,6 @@ import org.apache.poi.ss.util.CellRangeA
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.ss.util.WorkbookUtil;
 import org.apache.poi.util.*;
-import org.apache.poi.xslf.usermodel.XSLFPictureData;
 import org.apache.poi.xssf.model.*;
 import org.apache.poi.xssf.usermodel.helpers.XSSFFormulaUtils;
 import org.apache.xmlbeans.XmlException;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org