Author: fanningpj
Date: Sat Jun 27 10:08:14 2020
New Revision: 1879257
URL: http://svn.apache.org/viewvc?rev=1879257&view=rev
Log:
try to fix test compile
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
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=1879257&r1=1879256&r2=1879257&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
Sat Jun 27 10:08:14 2020
@@ -1019,6 +1019,25 @@ public class XSSFWorkbook extends POIXML
}
/**
+ * Get the named range at the given index. No longer public and only used
in tests.
+ *
+ * @param nameIndex the index of the named range
+ * @return the XSSFName at the given index
+ */
+ @Deprecated
+ XSSFName getNameAt(int nameIndex) {
+ int nNames = namedRanges.size();
+ if (nNames < 1) {
+ throw new IllegalStateException("There are no defined names in
this workbook");
+ }
+ if (nameIndex < 0 || nameIndex > nNames) {
+ throw new IllegalArgumentException("Specified name index " +
nameIndex
+ + " is outside the allowable range (0.." + (nNames-1) +
").");
+ }
+ return namedRanges.get(nameIndex);
+ }
+
+ /**
* Get a list of all the named ranges in the workbook.
*
* @return list of XSSFNames in the workbook
@@ -1029,6 +1048,24 @@ public class XSSFWorkbook extends POIXML
}
/**
+ * Gets the named range index by name. No longer public and only used in
tests.
+ *
+ * @param name named range name
+ * @return named range index. <code>-1</code> is returned if no named
ranges could be found.
+ *
+ * @deprecated 3.16. New projects should avoid accessing named ranges by
index.
+ * Use {@link #getName(String)} instead.
+ */
+ @Deprecated
+ int getNameIndex(String name) {
+ XSSFName nm = getName(name);
+ if (nm != null) {
+ return namedRanges.indexOf(nm);
+ }
+ return -1;
+ }
+
+ /**
* Get the number of styles the workbook contains
*
* @return count of cell styles
@@ -1225,9 +1262,6 @@ public class XSSFWorkbook extends POIXML
}
/**
- * As {@link #removeName(String)} is not necessarily unique
- * (name + sheet index is unique), this method is more accurate.
- *
* @param name the name to remove.
*
* @throws IllegalArgumentException if the named range is not a part of
this XSSFWorkbook
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]