poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fannin...@apache.org
Subject svn commit: r1808402 - in /poi/trunk/src: java/org/apache/poi/hssf/usermodel/ java/org/apache/poi/hssf/util/ java/org/apache/poi/ss/usermodel/ java/org/apache/poi/ss/util/ ooxml/java/org/apache/poi/xslf/usermodel/ ooxml/java/org/apache/poi/xssf/streami...
Date Thu, 14 Sep 2017 23:09:08 GMT
Author: fanningpj
Date: Thu Sep 14 23:09:08 2017
New Revision: 1808402

URL: http://svn.apache.org/viewvc?rev=1808402&view=rev
Log:
remove some deprecated code slated for removal in 3.18

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
    poi/trunk/src/java/org/apache/poi/hssf/util/HSSFRegionUtil.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java
    poi/trunk/src/java/org/apache/poi/ss/util/RegionUtil.java
    poi/trunk/src/java/org/apache/poi/ss/util/WorkbookUtil.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.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=1808402&r1=1808401&r2=1808402&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 Thu Sep 14 23:09:08
2017
@@ -118,7 +118,6 @@ import org.apache.poi.util.LittleEndianB
 import org.apache.poi.util.LittleEndianByteArrayOutputStream;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
-import org.apache.poi.util.Removal;
 
 /**
  * High level representation of a workbook.  This is the first object most users
@@ -767,26 +766,6 @@ public final class HSSFWorkbook extends
         setSheetVisibility(sheetIx, hidden ? SheetVisibility.HIDDEN : SheetVisibility.VISIBLE);
     }
 
-    @Removal(version="3.18")
-    @Deprecated
-    @Override
-    public void setSheetHidden(int sheetIx, int hidden) {
-        switch (hidden) {
-            case Workbook.SHEET_STATE_VISIBLE:
-                setSheetVisibility(sheetIx, SheetVisibility.VISIBLE);
-                break;
-            case Workbook.SHEET_STATE_HIDDEN:
-                setSheetVisibility(sheetIx, SheetVisibility.HIDDEN);
-                break;
-            case Workbook.SHEET_STATE_VERY_HIDDEN:
-                setSheetVisibility(sheetIx, SheetVisibility.VERY_HIDDEN);
-                break;
-            default:
-                throw new IllegalArgumentException("Invalid sheet state : " + hidden + "\n"
+
-                        "Sheet state must beone of the Workbook.SHEET_STATE_* constants");
-        }
-    }
-    
     @Override
     public void setSheetVisibility(int sheetIx, SheetVisibility visibility) {
         validateSheetIndex(sheetIx);
@@ -2257,15 +2236,6 @@ public final class HSSFWorkbook extends
     public boolean changeExternalReference(String oldUrl, String newUrl) {
     	return workbook.changeExternalReference(oldUrl, newUrl);
     }
-
-    /** 
-     * @deprecated POI 3.16 beta 1. use {@link POIDocument#getDirectory()} instead
-     */
-    @Deprecated
-    @Removal(version="3.18")
-    public DirectoryNode getRootDirectory(){
-        return getDirectory();
-    }
     
     @Internal
     public InternalWorkbook getInternalWorkbook() {

Modified: poi/trunk/src/java/org/apache/poi/hssf/util/HSSFRegionUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/util/HSSFRegionUtil.java?rev=1808402&r1=1808401&r2=1808402&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/util/HSSFRegionUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/util/HSSFRegionUtil.java Thu Sep 14 23:09:08 2017
@@ -19,12 +19,17 @@ package org.apache.poi.hssf.util;
 
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.BorderStyle;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.RegionUtil;
+import org.apache.poi.util.Removal;
 
 /**
  * Various utility functions that make working with a region of cells easier.
+ * @deprecated POI 3.18
+ * @see RegionUtil
  */
+@Removal(version="3.20")
 public final class HSSFRegionUtil {
 
 	private HSSFRegionUtil() {
@@ -42,7 +47,7 @@ public final class HSSFRegionUtil {
 	 */
 	public static void setBorderLeft(int border, CellRangeAddress region, HSSFSheet sheet,
 			HSSFWorkbook workbook) {
-		RegionUtil.setBorderLeft(border, region, sheet);
+		RegionUtil.setBorderLeft(BorderStyle.valueOf((short)border), region, sheet);
 	}
 
 	/**
@@ -68,7 +73,7 @@ public final class HSSFRegionUtil {
 	 */
 	public static void setBorderRight(int border, CellRangeAddress region, HSSFSheet sheet,
 			HSSFWorkbook workbook) {
-		RegionUtil.setBorderRight(border, region, sheet);
+		RegionUtil.setBorderRight(BorderStyle.valueOf((short)border), region, sheet);
 	}
 
 	/**
@@ -94,7 +99,7 @@ public final class HSSFRegionUtil {
 	 */
 	public static void setBorderBottom(int border, CellRangeAddress region, HSSFSheet sheet,
 			HSSFWorkbook workbook) {
-		RegionUtil.setBorderBottom(border, region, sheet);
+		RegionUtil.setBorderBottom(BorderStyle.valueOf((short)border), region, sheet);
 	}
 
 	/**
@@ -120,7 +125,7 @@ public final class HSSFRegionUtil {
 	 */
 	public static void setBorderTop(int border, CellRangeAddress region, HSSFSheet sheet,
 			HSSFWorkbook workbook) {
-		RegionUtil.setBorderTop(border, region, sheet);
+		RegionUtil.setBorderTop(BorderStyle.valueOf((short)border), region, sheet);
 	}
 
 	/**

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java?rev=1808402&r1=1808401&r2=1808402&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Workbook.java Thu Sep 14 23:09:08 2017
@@ -53,42 +53,6 @@ public interface Workbook extends Closea
     /** Device independent bitmap */
     int PICTURE_TYPE_DIB = 7;
 
-
-    /**
-     * Indicates the sheet is visible.
-     *
-     * @see #setSheetHidden(int, int)
-     * @deprecated POI 3.16 beta 2. Use {@link SheetVisibility#VISIBLE} instead.
-     */
-    @Deprecated
-    @Removal(version="3.18")
-    int SHEET_STATE_VISIBLE = 0;
-
-    /**
-     * Indicates the book window is hidden, but can be shown by the user via the user interface.
-     *
-     * @see #setSheetHidden(int, int)
-     * @deprecated POI 3.16 beta 2. Use {@link SheetVisibility#HIDDEN} instead.
-     */
-    @Deprecated
-    @Removal(version="3.18")
-    int SHEET_STATE_HIDDEN = 1;
-
-    /**
-     * Indicates the sheet is hidden and cannot be shown in the user interface (UI).
-     *
-     * <p>
-     * In Excel this state is only available programmatically in VBA:
-     * <code>ThisWorkbook.Sheets("MySheetName").Visible = xlSheetVeryHidden </code>
-     * </p>
-     *
-     * @see #setSheetHidden(int, int)
-     * @deprecated POI 3.16 beta 2. Use {@link SheetVisibility#VERY_HIDDEN} instead.
-     */
-    @Deprecated
-    @Removal(version="3.18")
-    int SHEET_STATE_VERY_HIDDEN = 2;
-
     /**
      * Convenience method to get the active sheet.  The active sheet is is the sheet
      * which is currently displayed when the workbook is viewed in Excel.
@@ -384,7 +348,10 @@ public interface Workbook extends Closea
      * @param nameIndex position of the named range (0-based)
      * @return the defined name at the specified index
      * @throws IllegalArgumentException if the supplied index is invalid
+     * @deprecated 3.18. New projects should avoid accessing named ranges by index.
      */
+    @Deprecated
+    @Removal(version="3.20")
     Name getNameAt(int nameIndex);
 
     /**
@@ -401,27 +368,38 @@ public interface Workbook extends Closea
      *
      * @param name the name of the defined name
      * @return zero based index of the defined name. <tt>-1</tt> if not found.
+     * @deprecated 3.18. New projects should avoid accessing named ranges by index.
+     * Use {@link #getName(String)} instead.
      */
+    @Deprecated
+    @Removal(version="3.20")
     int getNameIndex(String name);
 
     /**
      * Remove the defined name at the specified index
      *
      * @param index named range index (0 based)
+     *
+     * @deprecated 3.18. New projects should use {@link #removeName(Name)}.
      */
+    @Deprecated
+    @Removal(version="3.20")
     void removeName(int index);
 
     /**
      * Remove a defined name by name
      *
-      * @param name the name of the defined name
+     * @param name the name of the defined name
+     * @deprecated 3.18. New projects should use {@link #removeName(Name)}.
      */
+    @Deprecated
+    @Removal(version="3.20")
     void removeName(String name);
 
     /**
      * Remove a defined name
      *
-      * @param name the name of the defined name
+     * @param name the name of the defined name
      */
     void removeName(Name name);
 
@@ -580,29 +558,6 @@ public interface Workbook extends Closea
     void setSheetHidden(int sheetIx, boolean hidden);
 
     /**
-     * Hide or unhide a sheet.
-     *
-     * <ul>
-     *  <li>0 - visible. </li>
-     *  <li>1 - hidden. </li>
-     *  <li>2 - very hidden.</li>
-     * </ul>
-     * 
-     * Please note that the sheet currently set as active sheet (sheet 0 in a newly 
-     * created workbook or the one set via setActiveSheet()) cannot be hidden.
-     *  
-     * @param sheetIx the sheet index (0-based)
-     * @param hidden one of the following <code>Workbook</code> constants:
-     *        <code>Workbook.SHEET_STATE_VISIBLE</code>,
-     *        <code>Workbook.SHEET_STATE_HIDDEN</code>, or
-     *        <code>Workbook.SHEET_STATE_VERY_HIDDEN</code>.
-     * @throws IllegalArgumentException if the supplied sheet index or state is invalid
-     * @deprecated POI 3.16 beta 2. Use {@link #setSheetVisibility(int, SheetVisibility)}
instead.
-     */
-    @Removal(version="3.18")
-    void setSheetHidden(int sheetIx, int hidden);
-    
-    /**
      * Get the visibility (visible, hidden, very hidden) of a sheet in this workbook
      *
      * @param sheetIx  the index of the sheet

Modified: poi/trunk/src/java/org/apache/poi/ss/util/RegionUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/RegionUtil.java?rev=1808402&r1=1808401&r2=1808402&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/RegionUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/RegionUtil.java Thu Sep 14 23:09:08 2017
@@ -21,7 +21,6 @@ import org.apache.poi.ss.usermodel.Borde
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.util.Removal;
 
 /**
  * Various utility functions that make working with a region of cells easier.
@@ -64,27 +63,6 @@ public final class RegionUtil {
      * @param border The new border
      * @param region The region that should have the border
      * @param sheet The sheet that the region is on.
-     * @since POI 3.15 beta 2
-     * @deprecated 3.16 beta 1. Use {@link #setBorderLeft(BorderStyle, CellRangeAddress,
Sheet)}.
-     */
-    @Removal(version="3.18")
-    public static void setBorderLeft(int border, CellRangeAddress region, Sheet sheet) {
-        int rowStart = region.getFirstRow();
-        int rowEnd = region.getLastRow();
-        int column = region.getFirstColumn();
-
-        CellPropertySetter cps = new CellPropertySetter(CellUtil.BORDER_LEFT, border);
-        for (int i = rowStart; i <= rowEnd; i++) {
-            cps.setProperty(CellUtil.getRow(i, sheet), column);
-        }
-    }
-    /**
-     * Sets the left border style for a region of cells by manipulating the cell style of
the individual
-     * cells on the left
-     * 
-     * @param border The new border
-     * @param region The region that should have the border
-     * @param sheet The sheet that the region is on.
      * @since POI 3.16 beta 1
      */
     public static void setBorderLeft(BorderStyle border, CellRangeAddress region, Sheet sheet)
{
@@ -125,27 +103,6 @@ public final class RegionUtil {
      * @param border The new border
      * @param region The region that should have the border
      * @param sheet The sheet that the region is on.
-     * @since POI 3.15 beta 2
-     * @deprecated POI 3.16 beta 1. Use {@link #setBorderRight(BorderStyle, CellRangeAddress,
Sheet)}.
-     */
-    @Removal(version="3.18")
-    public static void setBorderRight(int border, CellRangeAddress region, Sheet sheet) {
-        int rowStart = region.getFirstRow();
-        int rowEnd = region.getLastRow();
-        int column = region.getLastColumn();
-
-        CellPropertySetter cps = new CellPropertySetter(CellUtil.BORDER_RIGHT, border);
-        for (int i = rowStart; i <= rowEnd; i++) {
-            cps.setProperty(CellUtil.getRow(i, sheet), column);
-        }
-    }
-    /**
-     * Sets the right border style for a region of cells by manipulating the cell style of
the individual
-     * cells on the right
-     * 
-     * @param border The new border
-     * @param region The region that should have the border
-     * @param sheet The sheet that the region is on.
      * @since POI 3.16 beta 1
      */
     public static void setBorderRight(BorderStyle border, CellRangeAddress region, Sheet
sheet) {
@@ -186,27 +143,6 @@ public final class RegionUtil {
      * @param border The new border
      * @param region The region that should have the border
      * @param sheet The sheet that the region is on.
-     * @since POI 3.15 beta 2
-     * @deprecated POI 3.16 beta 1. Use {@link #setBorderBottom(BorderStyle, CellRangeAddress,
Sheet)}.
-     */
-    @Removal(version="3.18")
-    public static void setBorderBottom(int border, CellRangeAddress region, Sheet sheet)
{
-        int colStart = region.getFirstColumn();
-        int colEnd = region.getLastColumn();
-        int rowIndex = region.getLastRow();
-        CellPropertySetter cps = new CellPropertySetter(CellUtil.BORDER_BOTTOM, border);
-        Row row = CellUtil.getRow(rowIndex, sheet);
-        for (int i = colStart; i <= colEnd; i++) {
-            cps.setProperty(row, i);
-        }
-    }
-    /**
-     * Sets the bottom border style for a region of cells by manipulating the cell style
of the individual
-     * cells on the bottom
-     * 
-     * @param border The new border
-     * @param region The region that should have the border
-     * @param sheet The sheet that the region is on.
      * @since POI 3.16 beta 1
      */
     public static void setBorderBottom(BorderStyle border, CellRangeAddress region, Sheet
sheet) {
@@ -243,27 +179,6 @@ public final class RegionUtil {
     /**
      * Sets the top border style for a region of cells by manipulating the cell style of
the individual
      * cells on the top
-     * 
-     * @param border The new border
-     * @param region The region that should have the border
-     * @param sheet The sheet that the region is on.
-     * @since POI 3.15 beta 2
-     * @deprecated 3.16 beta 1. Use {@link #setBorderTop(BorderStyle, CellRangeAddress, Sheet)}.
-     */
-    @Removal(version="3.18")
-    public static void setBorderTop(int border, CellRangeAddress region, Sheet sheet) {
-        int colStart = region.getFirstColumn();
-        int colEnd = region.getLastColumn();
-        int rowIndex = region.getFirstRow();
-        CellPropertySetter cps = new CellPropertySetter(CellUtil.BORDER_TOP, border);
-        Row row = CellUtil.getRow(rowIndex, sheet);
-        for (int i = colStart; i <= colEnd; i++) {
-            cps.setProperty(row, i);
-        }
-    }
-    /**
-     * Sets the top border style for a region of cells by manipulating the cell style of
the individual
-     * cells on the top
      * 
      * @param border The new border
      * @param region The region that should have the border

Modified: poi/trunk/src/java/org/apache/poi/ss/util/WorkbookUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/WorkbookUtil.java?rev=1808402&r1=1808401&r2=1808402&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/WorkbookUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/WorkbookUtil.java Thu Sep 14 23:09:08 2017
@@ -17,10 +17,6 @@
 
 package org.apache.poi.ss.util;
 
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.util.Removal;
-
-
 /**
  * Helper methods for when working with Usermodel Workbooks
  */
@@ -161,26 +157,4 @@ public class WorkbookUtil {
         }
     }
 
-
-    /**
-     * Validates sheet state
-     *
-     * @param state the state to validate
-     * @throws IllegalArgumentException if state is not one of
-     *      {@link Workbook#SHEET_STATE_VISIBLE},
-     *      {@link Workbook#SHEET_STATE_HIDDEN} or
-     *      {@link Workbook#SHEET_STATE_VERY_HIDDEN}
-     * @deprecated POI 3.16 beta 2. Use {@link org.apache.poi.ss.usermodel.SheetVisibility}
instead.
-     */
-    @Removal(version="3.18")
-    @Deprecated
-    public static void validateSheetState(int state) {
-        switch(state){
-            case Workbook.SHEET_STATE_VISIBLE: break;
-            case Workbook.SHEET_STATE_HIDDEN: break;
-            case Workbook.SHEET_STATE_VERY_HIDDEN: break;
-            default: throw new IllegalArgumentException("Invalid sheet state : " + state
+ "\n" +
-                            "Sheet state must be one of the Workbook.SHEET_STATE_* constants");
-        }
-    }
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java?rev=1808402&r1=1808401&r2=1808402&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java Thu Sep 14 23:09:08
2017
@@ -45,24 +45,13 @@ import org.apache.poi.sl.draw.Drawable;
 import org.apache.poi.sl.usermodel.PictureData;
 import org.apache.poi.sl.usermodel.Placeholder;
 import org.apache.poi.sl.usermodel.Sheet;
-import org.apache.poi.util.Beta;
-import org.apache.poi.util.IOUtils;
-import org.apache.poi.util.Internal;
-import org.apache.poi.util.POILogFactory;
-import org.apache.poi.util.POILogger;
-import org.apache.poi.util.Removal;
+import org.apache.poi.util.*;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTCommonSlideData;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
+import org.openxmlformats.schemas.presentationml.x2006.main.*;
 
 @Beta
 public abstract class XSLFSheet extends POIXMLDocumentPart
@@ -156,21 +145,12 @@ implements XSLFShapeContainer, Sheet<XSL
      * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
      */
     @Removal(version="3.18")
-    @Internal
-    public XSLFCommonSlideData getCommonSlideData() {
-       return _commonSlideData;
-    }
-
-    /*
-     * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
-     */
-    @Removal(version="3.18")
     protected void setCommonSlideData(CTCommonSlideData data) {
-       if(data == null) {
-          _commonSlideData = null;
-       } else {
-          _commonSlideData = new XSLFCommonSlideData(data);
-       }
+        if(data == null) {
+            _commonSlideData = null;
+        } else {
+            _commonSlideData = new XSLFCommonSlideData(data);
+        }
     }
 
     private XSLFDrawing getDrawing(){

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java?rev=1808402&r1=1808401&r2=1808402&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java Thu Sep 14 23:09:08
2017
@@ -49,13 +49,7 @@ import org.apache.poi.ss.usermodel.Row.M
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.SheetVisibility;
 import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.util.IOUtils;
-import org.apache.poi.util.Internal;
-import org.apache.poi.util.NotImplemented;
-import org.apache.poi.util.POILogFactory;
-import org.apache.poi.util.POILogger;
-import org.apache.poi.util.Removal;
-import org.apache.poi.util.TempFile;
+import org.apache.poi.util.*;
 import org.apache.poi.xssf.model.SharedStringsTable;
 import org.apache.poi.xssf.usermodel.XSSFChartSheet;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
@@ -1011,20 +1005,6 @@ public class SXSSFWorkbook implements Wo
     }
 
     /**
-     * @param nameIndex position of the named range (0-based)
-     * @return the defined name at the specified index
-     * @throws IllegalArgumentException if the supplied index is invalid
-     * @deprecated 3.16. New projects should avoid accessing named ranges by index.
-     */
-    @Override
-    @Deprecated
-    @Removal(version="3.18")
-    public Name getNameAt(int nameIndex) {
-        //noinspection deprecation
-        return _wb.getNameAt(nameIndex);
-    }
-
-    /**
      * Creates a new (uninitialised) defined name in this workbook
      *
      * @return new defined name object
@@ -1036,56 +1016,6 @@ public class SXSSFWorkbook implements Wo
     }
 
     /**
-     * Gets the defined name index by name
-     * 
-     * <i>Note:</i> Excel defined names are case-insensitive and
-     * this method performs a case-insensitive search.
-     *
-     * @param name the name of the defined name
-     * @return zero based index of the defined name. <code>-1</code> if not found.
-     *
-     * @deprecated 3.16. New projects should avoid accessing named ranges by index.
-     * Use {@link #getName(String)} instead.
-     */
-    @Override
-    @Deprecated
-    @Removal(version="3.18")
-    public int getNameIndex(String name) {
-        //noinspection deprecation
-        return _wb.getNameIndex(name);
-    }
-
-    /**
-     * Remove the defined name at the specified index
-     *
-     * @param index named range index (0 based)
-     *
-     * @deprecated 3.16. New projects should use {@link #removeName(Name)}.
-     */
-    @Override
-    @Deprecated
-    @Removal(version="3.18")
-    public void removeName(int index) {
-        //noinspection deprecation
-        _wb.removeName(index);
-    }
-
-    /**
-     * Remove a defined name by name
-     *
-     * @param name the name of the defined name
-     *
-     * @deprecated 3.16. New projects should use {@link #removeName(Name)}.
-     */
-    @Override
-    @Deprecated
-    @Removal(version="3.18")
-    public void removeName(String name) {
-        //noinspection deprecation
-        _wb.removeName(name);
-    }
-
-    /**
      * Remove the given defined name
      *
      * @param name the name to remove
@@ -1269,17 +1199,72 @@ public class SXSSFWorkbook implements Wo
         _wb.setSheetHidden(sheetIx,hidden);
     }
 
-    @Removal(version="3.18")
+    @Override
+    public void setSheetVisibility(int sheetIx, SheetVisibility visibility) {
+        _wb.setSheetVisibility(sheetIx, visibility);
+    }
+
+    /**
+     * @param nameIndex position of the named range (0-based)
+     * @return the defined name at the specified index
+     * @throws IllegalArgumentException if the supplied index is invalid
+     * @deprecated 3.16. New projects should avoid accessing named ranges by index.
+     */
+    @Override
     @Deprecated
+    @Removal(version="3.20")
+    public Name getNameAt(int nameIndex) {
+        //noinspection deprecation
+        return _wb.getNameAt(nameIndex);
+    }
+
+    /**
+     * Gets the defined name index by name
+     *
+     * <i>Note:</i> Excel defined names are case-insensitive and
+     * this method performs a case-insensitive search.
+     *
+     * @param name the name of the defined name
+     * @return zero based index of the defined name. <code>-1</code> if not found.
+     *
+     * @deprecated 3.16. New projects should avoid accessing named ranges by index.
+     * Use {@link #getName(String)} instead.
+     */
     @Override
-    public void setSheetHidden(int sheetIx, int hidden)
-    {
-        _wb.setSheetHidden(sheetIx,hidden);
+    @Deprecated
+    @Removal(version="3.20")
+    public int getNameIndex(String name) {
+        //noinspection deprecation
+        return _wb.getNameIndex(name);
     }
-    
+
+    /**
+     * Remove the defined name at the specified index
+     * @param index named range index (0 based)
+     *
+     * @deprecated 3.16. New projects should use {@link #removeName(Name)}.
+     */
     @Override
-    public void setSheetVisibility(int sheetIx, SheetVisibility visibility) {
-        _wb.setSheetVisibility(sheetIx, visibility);
+    @Deprecated
+    @Removal(version="3.20")
+    public void removeName(int index) {
+        //noinspection deprecation
+        _wb.removeName(index);
+    }
+
+    /**
+     * Remove a defined name by name
+     *
+     * @param name the name of the defined name
+     *
+     * @deprecated 3.16. New projects should use {@link #removeName(Name)}.
+     */
+    @Override
+    @Deprecated
+    @Removal(version="3.20")
+    public void removeName(String name) {
+        //noinspection deprecation
+        _wb.removeName(name);
     }
     
     /**

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=1808402&r1=1808401&r2=1808402&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 Thu Sep 14 23:09:08
2017
@@ -1906,14 +1906,6 @@ public class XSSFWorkbook extends POIXML
         setSheetVisibility(sheetIx, hidden ? SheetVisibility.HIDDEN : SheetVisibility.VISIBLE);
     }
 
-    @Deprecated
-    @Removal(version="3.18")
-    @Override
-    public void setSheetHidden(int sheetIx, int state) {
-        WorkbookUtil.validateSheetState(state);
-        setSheetVisibility(sheetIx, SheetVisibility.values()[state]);
-    }
-    
     @Override
     public void setSheetVisibility(int sheetIx, SheetVisibility visibility) {
         validateSheetIndex(sheetIx);

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java?rev=1808402&r1=1808401&r2=1808402&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java Thu Sep 14
23:09:08 2017
@@ -20,12 +20,10 @@ package org.apache.poi.ss.usermodel;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
 import org.apache.poi.ss.ITestDataProvider;
-import org.apache.poi.util.Removal;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -60,49 +58,6 @@ public abstract class BaseTestSheetHidin
 	    wbU.close();
 	}
 	
-	/**
-	 * @deprecated 3.16 beta 2. Use {@link #testSheetVisibility()} instead.
-	 *
-	 * @throws IOException
-	 */
-	@Removal(version="3.18")
-	@Deprecated
-	@Test
-    public final void testSheetHiddenOld() throws IOException {
-        Workbook wb = _testDataProvider.createWorkbook();
-        wb.createSheet("MySheet");
-
-        assertFalse(wb.isSheetHidden(0));
-        assertFalse(wb.isSheetVeryHidden(0));
-
-        wb.setSheetHidden(0, Workbook.SHEET_STATE_HIDDEN);
-        assertTrue(wb.isSheetHidden(0));
-        assertFalse(wb.isSheetVeryHidden(0));
-
-        wb.setSheetHidden(0, Workbook.SHEET_STATE_VERY_HIDDEN);
-        assertFalse(wb.isSheetHidden(0));
-        assertTrue(wb.isSheetVeryHidden(0));
-
-        wb.setSheetHidden(0, Workbook.SHEET_STATE_VISIBLE);
-        assertFalse(wb.isSheetHidden(0));
-        assertFalse(wb.isSheetVeryHidden(0));
-
-        try {
-            wb.setSheetHidden(0, -1);
-            fail("expectd exception");
-        } catch (IllegalArgumentException e){
-            // ok
-        }
-        try {
-            wb.setSheetHidden(0, 3);
-            fail("expectd exception");
-        } catch (IllegalArgumentException e){
-            // ok
-        }
-
-        wb.close();
-    }
-    
     @Test
     public final void testSheetVisibility() throws IOException {
         Workbook wb = _testDataProvider.createWorkbook();



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


Mime
View raw message