]> source.dussan.org Git - poi.git/commitdiff
bug 59264: revert CellStyle#getBorder[Top|Bottom|Left|Right]() to return short and...
authorJaven O'Neal <onealj@apache.org>
Wed, 14 Sep 2016 05:22:23 +0000 (05:22 +0000)
committerJaven O'Neal <onealj@apache.org>
Wed, 14 Sep 2016 05:22:23 +0000 (05:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760630 13f79535-47bb-0310-9956-ffa450edef68

17 files changed:
src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java
src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
src/java/org/apache/poi/ss/usermodel/CellStyle.java
src/java/org/apache/poi/ss/util/CellUtil.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java
src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFOptimiser.java
src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestBorderStyle.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java

index ac0075b16b3634bda8df70e97707ebb29c209a00..8a59b8306fdba2a12fac3dbcda6c3df894739099 100644 (file)
@@ -160,8 +160,8 @@ public class SVTableCellRenderer extends JLabel
                                SVTableUtils.getAWTColor(s.getRightBorderColor(), SVTableUtils.black),
                                SVTableUtils.getAWTColor(s.getBottomBorderColor(), SVTableUtils.black),
                                SVTableUtils.getAWTColor(s.getLeftBorderColor(), SVTableUtils.black),
-                               s.getBorderTop(), s.getBorderRight(),
-                               s.getBorderBottom(), s.getBorderLeft(),
+                               s.getBorderTopEnum(), s.getBorderRightEnum(),
+                               s.getBorderBottomEnum(), s.getBorderLeftEnum(),
                                hasFocus);
             setBorder(cellBorder);
             isBorderSet=true;
index dce4b0196e1157ed2ea006b9add24b5f29559837..d6f846a6bb0c8756050cf1cedeb702ea185c5939 100644 (file)
@@ -367,23 +367,23 @@ public class ExcelComparator {
         String borderName;\r
         switch (borderSide) {\r
             case 't': default:\r
-                b1 = style1.getBorderTop() == BorderStyle.THIN;\r
-                b2 = style2.getBorderTop() == BorderStyle.THIN;\r
+                b1 = style1.getBorderTopEnum() == BorderStyle.THIN;\r
+                b2 = style2.getBorderTopEnum() == BorderStyle.THIN;\r
                 borderName = "TOP";\r
                 break;\r
             case 'b':\r
-                b1 = style1.getBorderBottom() == BorderStyle.THIN;\r
-                b2 = style2.getBorderBottom() == BorderStyle.THIN;\r
+                b1 = style1.getBorderBottomEnum() == BorderStyle.THIN;\r
+                b2 = style2.getBorderBottomEnum() == BorderStyle.THIN;\r
                 borderName = "BOTTOM";\r
                 break;\r
             case 'l':\r
-                b1 = style1.getBorderLeft() == BorderStyle.THIN;\r
-                b2 = style2.getBorderLeft() == BorderStyle.THIN;\r
+                b1 = style1.getBorderLeftEnum() == BorderStyle.THIN;\r
+                b2 = style2.getBorderLeftEnum() == BorderStyle.THIN;\r
                 borderName = "LEFT";\r
                 break;\r
             case 'r':\r
-                b1 = style1.getBorderRight() == BorderStyle.THIN;\r
-                b2 = style2.getBorderRight() == BorderStyle.THIN;\r
+                b1 = style1.getBorderRightEnum() == BorderStyle.THIN;\r
+                b2 = style2.getBorderRightEnum() == BorderStyle.THIN;\r
                 borderName = "RIGHT";\r
                 break;\r
         }\r
index c5fdc1da9a7056c3cc5a7fea9c8cc14555b3a447..f5d2ecba8dc128b62de03c4dc54b5e299f51e40b 100644 (file)
@@ -298,10 +298,10 @@ public class ToHtml {
     }
 
     private void borderStyles(CellStyle style) {
-        styleOut("border-left", style.getBorderLeft(), BORDER);
-        styleOut("border-right", style.getBorderRight(), BORDER);
-        styleOut("border-top", style.getBorderTop(), BORDER);
-        styleOut("border-bottom", style.getBorderBottom(), BORDER);
+        styleOut("border-left", style.getBorderLeftEnum(), BORDER);
+        styleOut("border-right", style.getBorderRightEnum(), BORDER);
+        styleOut("border-top", style.getBorderTopEnum(), BORDER);
+        styleOut("border-bottom", style.getBorderBottomEnum(), BORDER);
     }
 
     private void fontStyle(CellStyle style) {
index 4fbbdf62ea71b3715c51499a34297fd742945888..0fd7cf2aded4de7f5f4fd43e715f6fb807c21e71 100644 (file)
@@ -331,6 +331,7 @@ public final class HSSFCellStyle implements CellStyle {
      * @see VerticalAlignment
      * @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setVerticalAlignment(short align)
     {
@@ -461,6 +462,7 @@ public final class HSSFCellStyle implements CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderLeft(BorderStyle)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderLeft(short border)
     {
@@ -471,6 +473,7 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * set the type of border to use for the left border of the cell
      * @param border type
+     * @since POI 3.15
      */
     @Override
     public void setBorderLeft(BorderStyle border)
@@ -481,9 +484,20 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * get the type of border to use for the left border of the cell
      * @return border type
+     * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderLeftEnum()}.
+     */
+    @Override
+    public short getBorderLeft()
+    {
+        return _format.getBorderLeft();
+    }
+    /**
+     * get the type of border to use for the left border of the cell
+     * @return border type
+     * @since POI 3.15
      */
     @Override
-    public BorderStyle getBorderLeft()
+    public BorderStyle getBorderLeftEnum()
     {
         return BorderStyle.valueOf(_format.getBorderLeft());
     }
@@ -507,6 +521,7 @@ public final class HSSFCellStyle implements CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderRight(BorderStyle)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderRight(short border)
     {
@@ -517,6 +532,7 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * set the type of border to use for the right border of the cell
      * @param border type
+     * @since POI 3.15
      */
     @Override
     public void setBorderRight(BorderStyle border)
@@ -527,9 +543,20 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * get the type of border to use for the right border of the cell
      * @return border type
+     * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderRightEnum()}.
+     */
+    @Override
+    public short getBorderRight()
+    {
+        return _format.getBorderRight();
+    }
+    /**
+     * get the type of border to use for the right border of the cell
+     * @return border type
+     * @since POI 3.15
      */
     @Override
-    public BorderStyle getBorderRight()
+    public BorderStyle getBorderRightEnum()
     {
         return BorderStyle.valueOf(_format.getBorderRight());
     }
@@ -553,6 +580,7 @@ public final class HSSFCellStyle implements CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderTop(BorderStyle)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderTop(short border)
     {
@@ -563,6 +591,7 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * set the type of border to use for the top border of the cell
      * @param border type
+     * @since POI 3.15
      */
     @Override
     public void setBorderTop(BorderStyle border)
@@ -573,9 +602,20 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * get the type of border to use for the top border of the cell
      * @return border type
+     * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderTopEnum()}.
      */
     @Override
-    public BorderStyle getBorderTop()
+    public short getBorderTop()
+    {
+        return _format.getBorderTop();
+    }
+    /**
+     * get the type of border to use for the top border of the cell
+     * @return border type
+     * @since 3.15
+     */
+    @Override
+    public BorderStyle getBorderTopEnum()
     {
         return BorderStyle.valueOf(_format.getBorderTop());
     }
@@ -599,6 +639,7 @@ public final class HSSFCellStyle implements CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderBottom(BorderStyle)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderBottom(short border)
     {
@@ -609,6 +650,7 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * set the type of border to use for the bottom border of the cell
      * @param border type
+     * @since 3.15 beta 2
      */
     @Override
     public void setBorderBottom(BorderStyle border)
@@ -619,9 +661,20 @@ public final class HSSFCellStyle implements CellStyle {
     /**
      * get the type of border to use for the bottom border of the cell
      * @return border type
+     * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderBottomEnum()}.
      */
     @Override
-    public BorderStyle getBorderBottom()
+    public short getBorderBottom()
+    {
+        return _format.getBorderBottom();
+    }
+    /**
+     * get the type of border to use for the bottom border of the cell
+     * @return border type
+     * @since 3.15
+     */
+    @Override
+    public BorderStyle getBorderBottomEnum()
     {
         return BorderStyle.valueOf(_format.getBorderBottom());
     }
@@ -735,6 +788,7 @@ public final class HSSFCellStyle implements CellStyle {
      * @param fp  fill pattern (set to 1 to fill w/foreground color)
      * @deprecated POI 3.15 beta 3. Use {@link #setFillPattern(FillPatternType)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setFillPattern(short fp)
     {
index 17a5d0e75de0daf5805c5f04aee2b6d5cad0b0eb..df3d57259825f639d1070980164b69b377a26a40 100644 (file)
@@ -541,19 +541,29 @@ public interface CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)} instead
      */
+    @Removal(version="3.17")
     void setBorderLeft(short border);
     
     /**
      * set the type of border to use for the left border of the cell
      * @param border type
+     * @since POI 3.15
      */
     void setBorderLeft(BorderStyle border);
 
     /**
      * get the type of border to use for the left border of the cell
      * @return border type
+     * @deprecated POI 3.15. Use {@link #getBorderLeftEnum()} instead.
+     * This will return a BorderStyle enum in the future.
+     */
+    short getBorderLeft();
+    /**
+     * get the type of border to use for the left border of the cell
+     * @return border type
+     * @since POI 3.15
      */
-    BorderStyle getBorderLeft();
+    BorderStyle getBorderLeftEnum();
 
     /**
      * set the type of border to use for the right border of the cell
@@ -574,19 +584,29 @@ public interface CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)} instead
      */
+    @Removal(version="3.17")
     void setBorderRight(short border);
     
     /**
      * set the type of border to use for the right border of the cell
      * @param border type
+     * @since POI 3.15
      */
     void setBorderRight(BorderStyle border);
 
     /**
      * get the type of border to use for the right border of the cell
      * @return border type
+     * @deprecated POI 3.15. Use {@link #getBorderRightEnum()} instead.
+     * This will return a BorderStyle enum in the future.
+     */
+    short getBorderRight();
+    /**
+     * get the type of border to use for the right border of the cell
+     * @return border type
+     * @since POI 3.15
      */
-    BorderStyle getBorderRight();
+    BorderStyle getBorderRightEnum();
 
     /**
      * set the type of border to use for the top border of the cell
@@ -607,19 +627,29 @@ public interface CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)} instead
      */
+    @Removal(version="3.17")
     void setBorderTop(short border);
     
     /**
      * set the type of border to use for the top border of the cell
      * @param border type
+     * @since POI 3.15
      */
     void setBorderTop(BorderStyle border);
 
     /**
      * get the type of border to use for the top border of the cell
      * @return border type
+     * @deprecated POI 3.15. Use {@link #getBorderTopEnum()} instead.
+     * This will return a BorderStyle enum in the future.
+     */
+    short getBorderTop();
+    /**
+     * get the type of border to use for the top border of the cell
+     * @return border type
+     * @since POI 3.15
      */
-    BorderStyle getBorderTop();
+    BorderStyle getBorderTopEnum();
 
     /**
      * set the type of border to use for the bottom border of the cell
@@ -640,19 +670,29 @@ public interface CellStyle {
      * @see #BORDER_SLANTED_DASH_DOT
      * @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)} instead.
      */
+    @Removal(version="3.17")
     void setBorderBottom(short border);
     
     /**
      * set the type of border to use for the bottom border of the cell
      * @param border type
+     * @since POI 3.15
      */
     void setBorderBottom(BorderStyle border);
 
     /**
      * get the type of border to use for the bottom border of the cell
      * @return border type
+     * @deprecated POI 3.15. Use {@link #getBorderBottomEnum()} instead.
+     * This will return a BorderStyle enum in the future.
+     */
+    short getBorderBottom();
+    /**
+     * get the type of border to use for the bottom border of the cell
+     * @return border type
+     * @since POI 3.15
      */
-    BorderStyle getBorderBottom();
+    BorderStyle getBorderBottomEnum();
 
     /**
      * set the color to use for the left border
index 4f446c10dce116ccd618677a77c9e628dc5ee142..3dad83aab6fcbc1e20aac4b26c7c48d471e572ab 100644 (file)
@@ -405,10 +405,10 @@ public final class CellUtil {
         Map<String, Object> properties = new HashMap<String, Object>();
         put(properties, ALIGNMENT, style.getAlignmentEnum());
         put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignmentEnum());
-        put(properties, BORDER_BOTTOM, style.getBorderBottom());
-        put(properties, BORDER_LEFT, style.getBorderLeft());
-        put(properties, BORDER_RIGHT, style.getBorderRight());
-        put(properties, BORDER_TOP, style.getBorderTop());
+        put(properties, BORDER_BOTTOM, style.getBorderBottomEnum());
+        put(properties, BORDER_LEFT, style.getBorderLeftEnum());
+        put(properties, BORDER_RIGHT, style.getBorderRightEnum());
+        put(properties, BORDER_TOP, style.getBorderTopEnum());
         put(properties, BOTTOM_BORDER_COLOR, style.getBottomBorderColor());
         put(properties, DATA_FORMAT, style.getDataFormat());
         put(properties, FILL_PATTERN, style.getFillPatternEnum());
index 1e7dc50407808d793dbe0b301ea7af3f3109cf93..9eec21ec6feaa43682d18ff7e4e075672ae05fee 100644 (file)
@@ -252,11 +252,13 @@ public class XSSFCellStyle implements CellStyle {
 
     /**
      * Get the type of border to use for the bottom border of the cell
+     * Will be removed when {@link #getBorderBottom()} returns a BorderStyle enum
      *
      * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+     * @since POI 3.15
      */
     @Override
-    public BorderStyle getBorderBottom() {
+    public BorderStyle getBorderBottomEnum() {
         if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
 
         int idx = (int)_cellXf.getBorderId();
@@ -267,24 +269,26 @@ public class XSSFCellStyle implements CellStyle {
         }
         return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
     }
-
     /**
      * Get the type of border to use for the bottom border of the cell
+     * This will return a BorderStyle enum in the future.
      *
-     * @return border type as Java enum
-     * @deprecated 3.15 beta 2. Use {@link #getBorderBottom}
+     * @return border type code
+     * @deprecated 3.15 beta 2. Use {@link #getBorderBottomEnum()}
      */
-    public BorderStyle getBorderBottomEnum() {
-        return getBorderBottom();
+    public short getBorderBottom() {
+        return getBorderBottomEnum().getCode();
     }
 
     /**
      * Get the type of border to use for the left border of the cell
+     * Will be removed when {@link #getBorderLeft()} returns a BorderStyle enum
      *
      * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+     * @since POI 3.15
      */
     @Override
-    public BorderStyle getBorderLeft() {
+    public BorderStyle getBorderLeftEnum() {
         if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
 
         int idx = (int)_cellXf.getBorderId();
@@ -298,21 +302,24 @@ public class XSSFCellStyle implements CellStyle {
 
     /**
      * Get the type of border to use for the left border of the cell
+     * This will return a BorderStyle enum in the future.
      *
-     * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
-     * @deprecated 3.15 beta 2. Use {@link #getBorderLeft}
+     * @return border type code
+     * @deprecated 3.15 beta 2. Use {@link #getBorderLeftEnum()}
      */
-    public BorderStyle getBorderLeftEnum() {
-        return getBorderLeft();
+    public short getBorderLeft() {
+        return getBorderLeftEnum().getCode();
     }
 
     /**
      * Get the type of border to use for the right border of the cell
+     * Will be removed when {@link #getBorderRight()} returns a BorderStyle enum
      *
      * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+     * @since POI 3.15
      */
     @Override
-    public BorderStyle getBorderRight() {
+    public BorderStyle getBorderRightEnum() {
         if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
 
         int idx = (int)_cellXf.getBorderId();
@@ -323,24 +330,26 @@ public class XSSFCellStyle implements CellStyle {
         }
         return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
     }
-
     /**
      * Get the type of border to use for the right border of the cell
+     * This will return a BorderStyle enum in the future.
      *
      * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
-     * @deprecated 3.15 beta 2. Use {@link #getBorderRight}
+     * @deprecated 3.15 beta 2. Use {@link #getBorderRightEnum()} instead
      */
-    public BorderStyle getBorderRightEnum() {
-        return getBorderRight();
+    public short getBorderRight() {
+        return getBorderRightEnum().getCode();
     }
 
     /**
      * Get the type of border to use for the top border of the cell
+     * Will be removed when {@link #getBorderTop()} returns a BorderStyle enum
      *
      * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+     * @since POI 3.15
      */
     @Override
-    public BorderStyle getBorderTop() {
+    public BorderStyle getBorderTopEnum() {
         if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
 
         int idx = (int)_cellXf.getBorderId();
@@ -351,15 +360,15 @@ public class XSSFCellStyle implements CellStyle {
         }
         return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
     }
-
      /**
      * Get the type of border to use for the top border of the cell
+     * This will return a BorderStyle enum in the future.
      *
      * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
-     * @deprecated 3.15 beta 2. Use {@link #getBorderTop}
+     * @deprecated 3.15 beta 2. Use {@link #getBorderTopEnum()} instead.
      */
-    public BorderStyle getBorderTopEnum() {
-         return getBorderTop();
+    public short getBorderTop() {
+         return getBorderTopEnum().getCode();
     }
 
     /**
@@ -776,6 +785,7 @@ public class XSSFCellStyle implements CellStyle {
      * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_CENTER_SELECTION
      * @deprecated POI 3.15 beta 3. Use {@link #setAlignment(HorizontalAlignment)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setAlignment(short align) {
         setAlignment(HorizontalAlignment.forInt(align));
@@ -797,6 +807,7 @@ public class XSSFCellStyle implements CellStyle {
      * @param border the type of border to use
      * @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)}
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderBottom(short border) {
         setBorderBottom(BorderStyle.valueOf(border));
@@ -807,6 +818,7 @@ public class XSSFCellStyle implements CellStyle {
      *
      * @param border - type of border to use
      * @see org.apache.poi.ss.usermodel.BorderStyle
+     * @since POI 3.15
      */
     @Override
     public void setBorderBottom(BorderStyle border) {
@@ -826,6 +838,7 @@ public class XSSFCellStyle implements CellStyle {
      * @param border the type of border to use
      * @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)}
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderLeft(short border) {
         setBorderLeft(BorderStyle.valueOf(border));
@@ -835,6 +848,7 @@ public class XSSFCellStyle implements CellStyle {
      * Set the type of border to use for the left border of the cell
       *
      * @param border the type of border to use
+     * @since POI 3.15
      */
     @Override
     public void setBorderLeft(BorderStyle border) {
@@ -855,6 +869,7 @@ public class XSSFCellStyle implements CellStyle {
      * @param border the type of border to use
      * @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)}
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderRight(short border) {
         setBorderRight(BorderStyle.valueOf(border));
@@ -864,6 +879,7 @@ public class XSSFCellStyle implements CellStyle {
      * Set the type of border to use for the right border of the cell
       *
      * @param border the type of border to use
+     * @since POI 3.15
      */
     @Override
     public void setBorderRight(BorderStyle border) {
@@ -884,6 +900,7 @@ public class XSSFCellStyle implements CellStyle {
      * @param border the type of border to use
      * @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)}
      */
+    @Removal(version="3.17")
     @Override
     public void setBorderTop(short border) {
         setBorderTop(BorderStyle.valueOf(border));
@@ -893,6 +910,7 @@ public class XSSFCellStyle implements CellStyle {
      * Set the type of border to use for the top border of the cell
      *
      * @param border the type of border to use
+     * @since POI 3.15
      */
     @Override
     public void setBorderTop(BorderStyle border) {
@@ -1338,6 +1356,7 @@ public class XSSFCellStyle implements CellStyle {
      * @see org.apache.poi.ss.usermodel.VerticalAlignment
      * @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
      */
+    @Removal(version="3.17")
     @Override
     public void setVerticalAlignment(short align) {
         setVerticalAlignment(VerticalAlignment.forInt(align));
index 94e40a3a723c617afcf15f62818ff094049cb4fa..c907d40db305563dd6de34e57c4a8e3883aa4f0f 100644 (file)
@@ -104,11 +104,11 @@ public class TestXSSFCellStyle {
        @Test
        public void testGetSetBorderBottom() {
         //default values
-        assertEquals(BorderStyle.NONE, cellStyle.getBorderBottom());
+        assertEquals(BorderStyle.NONE, cellStyle.getBorderBottomEnum());
 
         int num = stylesTable.getBorders().size();
         cellStyle.setBorderBottom(BorderStyle.MEDIUM);
-        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom());
+        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottomEnum());
         //a new border has been added
         assertEquals(num + 1, stylesTable.getBorders().size());
         //id of the created border
@@ -122,7 +122,7 @@ public class TestXSSFCellStyle {
         //setting the same border multiple times should not change borderId
         for (int i = 0; i < 3; i++) {
             cellStyle.setBorderBottom(BorderStyle.MEDIUM);
-            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom());
+            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottomEnum());
         }
         assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
         assertEquals(num, stylesTable.getBorders().size());
@@ -139,11 +139,11 @@ public class TestXSSFCellStyle {
        @Test
     public void testGetSetBorderRight() {
         //default values
-        assertEquals(BorderStyle.NONE, cellStyle.getBorderRight());
+        assertEquals(BorderStyle.NONE, cellStyle.getBorderRightEnum());
 
         int num = stylesTable.getBorders().size();
         cellStyle.setBorderRight(BorderStyle.MEDIUM);
-        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight());
+        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRightEnum());
         //a new border has been added
         assertEquals(num + 1, stylesTable.getBorders().size());
         //id of the created border
@@ -157,7 +157,7 @@ public class TestXSSFCellStyle {
         //setting the same border multiple times should not change borderId
         for (int i = 0; i < 3; i++) {
             cellStyle.setBorderRight(BorderStyle.MEDIUM);
-            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight());
+            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRightEnum());
         }
         assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
         assertEquals(num, stylesTable.getBorders().size());
@@ -174,11 +174,11 @@ public class TestXSSFCellStyle {
        @Test
     public void testGetSetBorderLeft() {
         //default values
-        assertEquals(BorderStyle.NONE, cellStyle.getBorderLeft());
+        assertEquals(BorderStyle.NONE, cellStyle.getBorderLeftEnum());
 
         int num = stylesTable.getBorders().size();
         cellStyle.setBorderLeft(BorderStyle.MEDIUM);
-        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft());
+        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeftEnum());
         //a new border has been added
         assertEquals(num + 1, stylesTable.getBorders().size());
         //id of the created border
@@ -192,7 +192,7 @@ public class TestXSSFCellStyle {
         //setting the same border multiple times should not change borderId
         for (int i = 0; i < 3; i++) {
             cellStyle.setBorderLeft(BorderStyle.MEDIUM);
-            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft());
+            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeftEnum());
         }
         assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
         assertEquals(num, stylesTable.getBorders().size());
@@ -209,11 +209,11 @@ public class TestXSSFCellStyle {
        @Test
     public void testGetSetBorderTop() {
         //default values
-        assertEquals(BorderStyle.NONE, cellStyle.getBorderTop());
+        assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
 
         int num = stylesTable.getBorders().size();
         cellStyle.setBorderTop(BorderStyle.MEDIUM);
-        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop());
+        assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTopEnum());
         //a new border has been added
         assertEquals(num + 1, stylesTable.getBorders().size());
         //id of the created border
@@ -227,7 +227,7 @@ public class TestXSSFCellStyle {
         //setting the same border multiple times should not change borderId
         for (int i = 0; i < 3; i++) {
             cellStyle.setBorderTop(BorderStyle.MEDIUM);
-            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop());
+            assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTopEnum());
         }
         assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
         assertEquals(num, stylesTable.getBorders().size());
@@ -243,7 +243,7 @@ public class TestXSSFCellStyle {
     
     private void testGetSetBorderXMLBean(BorderStyle border, STBorderStyle.Enum expected) {
         cellStyle.setBorderTop(border);
-        assertEquals(border, cellStyle.getBorderTop());
+        assertEquals(border, cellStyle.getBorderTopEnum());
         int borderId = (int)cellStyle.getCoreXf().getBorderId();
         assertTrue(borderId > 0);
         //check changes in the underlying xml bean
@@ -256,7 +256,7 @@ public class TestXSSFCellStyle {
     @Test
     public void testGetSetBorderNone() {
         cellStyle.setBorderTop(BorderStyle.NONE);
-        assertEquals(BorderStyle.NONE, cellStyle.getBorderTop());
+        assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
         int borderId = (int)cellStyle.getCoreXf().getBorderId();
         assertTrue(borderId > 0);
         //check changes in the underlying xml bean
@@ -562,10 +562,10 @@ public class TestXSSFCellStyle {
         assertEquals(style2.getRightBorderColor(), style1.getRightBorderColor());
         assertEquals(style2.getBottomBorderColor(), style1.getBottomBorderColor());
 
-        assertEquals(style2.getBorderBottom(), style1.getBorderBottom());
-        assertEquals(style2.getBorderLeft(), style1.getBorderLeft());
-        assertEquals(style2.getBorderRight(), style1.getBorderRight());
-        assertEquals(style2.getBorderTop(), style1.getBorderTop());
+        assertEquals(style2.getBorderBottomEnum(), style1.getBorderBottomEnum());
+        assertEquals(style2.getBorderLeftEnum(), style1.getBorderLeftEnum());
+        assertEquals(style2.getBorderRightEnum(), style1.getBorderRightEnum());
+        assertEquals(style2.getBorderTopEnum(), style1.getBorderTopEnum());
         wb2.close();
        }
 
@@ -999,7 +999,7 @@ public class TestXSSFCellStyle {
         Workbook copy = XSSFTestDataSamples.writeOutAndReadBack(target);
 
         // previously this failed because the border-element was not copied over 
-        copy.getCellStyleAt((short)1).getBorderBottom();
+        copy.getCellStyleAt((short)1).getBorderBottomEnum();
         
         copy.close();
         
index 1c32edabe87d59704d049c0b9caf0da7e89c220a..29d7ffce04b84a4e18d9e023d15b8b958400b64a 100644 (file)
@@ -193,10 +193,10 @@ public class ExcelToFoConverter extends AbstractExcelConverter
     protected boolean isEmptyStyle( CellStyle cellStyle ) {
         return cellStyle == null || (
                cellStyle.getFillPattern() == 0
-            && cellStyle.getBorderTop() == BorderStyle.NONE
-            && cellStyle.getBorderRight() == BorderStyle.NONE
-            && cellStyle.getBorderBottom() == BorderStyle.NONE
-            && cellStyle.getBorderLeft() == BorderStyle.NONE
+            && cellStyle.getBorderTopEnum() == BorderStyle.NONE
+            && cellStyle.getBorderRightEnum() == BorderStyle.NONE
+            && cellStyle.getBorderBottomEnum() == BorderStyle.NONE
+            && cellStyle.getBorderLeftEnum() == BorderStyle.NONE
         );
     }
 
@@ -361,13 +361,13 @@ public class ExcelToFoConverter extends AbstractExcelConverter
         }
 
         processCellStyleBorder( workbook, cellTarget, "top",
-                cellStyle.getBorderTop(), cellStyle.getTopBorderColor() );
+                cellStyle.getBorderTopEnum(), cellStyle.getTopBorderColor() );
         processCellStyleBorder( workbook, cellTarget, "right",
-                cellStyle.getBorderRight(), cellStyle.getRightBorderColor() );
+                cellStyle.getBorderRightEnum(), cellStyle.getRightBorderColor() );
         processCellStyleBorder( workbook, cellTarget, "bottom",
-                cellStyle.getBorderBottom(), cellStyle.getBottomBorderColor() );
+                cellStyle.getBorderBottomEnum(), cellStyle.getBottomBorderColor() );
         processCellStyleBorder( workbook, cellTarget, "left",
-                cellStyle.getBorderLeft(), cellStyle.getLeftBorderColor() );
+                cellStyle.getBorderLeftEnum(), cellStyle.getLeftBorderColor() );
 
         HSSFFont font = cellStyle.getFont( workbook );
         processCellStyleFont( workbook, blockTarget, font );
index 54dc4d3196ea65f4b259138dc09ce070582c5c97..5019339d37bc8859f2ce9a70ac218a9f37789d3c 100644 (file)
@@ -175,13 +175,13 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
                 break;
         }
 
-        buildStyle_border( workbook, style, "top", cellStyle.getBorderTop(),
+        buildStyle_border( workbook, style, "top", cellStyle.getBorderTopEnum(),
                 cellStyle.getTopBorderColor() );
         buildStyle_border( workbook, style, "right",
-                cellStyle.getBorderRight(), cellStyle.getRightBorderColor() );
+                cellStyle.getBorderRightEnum(), cellStyle.getRightBorderColor() );
         buildStyle_border( workbook, style, "bottom",
-                cellStyle.getBorderBottom(), cellStyle.getBottomBorderColor() );
-        buildStyle_border( workbook, style, "left", cellStyle.getBorderLeft(),
+                cellStyle.getBorderBottomEnum(), cellStyle.getBottomBorderColor() );
+        buildStyle_border( workbook, style, "left", cellStyle.getBorderLeftEnum(),
                 cellStyle.getLeftBorderColor() );
 
         HSSFFont font = cellStyle.getFont( workbook );
index dca98f620872557b45f20b4f75fc89fab5e54fa4..2ce6e1de8a5a2bdea37953231da2fb3bbe89de30 100644 (file)
@@ -2567,7 +2567,7 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         HSSFSheet sheet = wb.getSheetAt(0);
         HSSFRow row = sheet.getRow(0);
         HSSFCellStyle rstyle = row.getRowStyle();
-        assertEquals(BorderStyle.DOUBLE, rstyle.getBorderBottom());
+        assertEquals(BorderStyle.DOUBLE, rstyle.getBorderBottomEnum());
         wb.close();
     }
 
index 7e6d8a3bcfe443047c0c706dc4f79c9ee13cc430..eec69b211c5b6b7948b78a397282794df34c87cc 100644 (file)
@@ -348,40 +348,40 @@ public final class TestCellStyle extends TestCase {
        HSSFCellStyle cs;
 
        cs = s.getRow(0).getCell(0).getCellStyle();
-       assertEquals(BorderStyle.HAIR, cs.getBorderRight());
+       assertEquals(BorderStyle.HAIR, cs.getBorderRightEnum());
 
        cs = s.getRow(1).getCell(1).getCellStyle();
-       assertEquals(BorderStyle.DOTTED, cs.getBorderRight());
+       assertEquals(BorderStyle.DOTTED, cs.getBorderRightEnum());
 
        cs = s.getRow(2).getCell(2).getCellStyle();
-       assertEquals(BorderStyle.DASH_DOT_DOT, cs.getBorderRight());
+       assertEquals(BorderStyle.DASH_DOT_DOT, cs.getBorderRightEnum());
 
        cs = s.getRow(3).getCell(3).getCellStyle();
-       assertEquals(BorderStyle.DASHED, cs.getBorderRight());
+       assertEquals(BorderStyle.DASHED, cs.getBorderRightEnum());
 
        cs = s.getRow(4).getCell(4).getCellStyle();
-       assertEquals(BorderStyle.THIN, cs.getBorderRight());
+       assertEquals(BorderStyle.THIN, cs.getBorderRightEnum());
 
        cs = s.getRow(5).getCell(5).getCellStyle();
-       assertEquals(BorderStyle.MEDIUM_DASH_DOT_DOT, cs.getBorderRight());
+       assertEquals(BorderStyle.MEDIUM_DASH_DOT_DOT, cs.getBorderRightEnum());
 
        cs = s.getRow(6).getCell(6).getCellStyle();
-       assertEquals(BorderStyle.SLANTED_DASH_DOT, cs.getBorderRight());
+       assertEquals(BorderStyle.SLANTED_DASH_DOT, cs.getBorderRightEnum());
 
        cs = s.getRow(7).getCell(7).getCellStyle();
-       assertEquals(BorderStyle.MEDIUM_DASH_DOT, cs.getBorderRight());
+       assertEquals(BorderStyle.MEDIUM_DASH_DOT, cs.getBorderRightEnum());
 
        cs = s.getRow(8).getCell(8).getCellStyle();
-       assertEquals(BorderStyle.MEDIUM_DASHED, cs.getBorderRight());
+       assertEquals(BorderStyle.MEDIUM_DASHED, cs.getBorderRightEnum());
 
        cs = s.getRow(9).getCell(9).getCellStyle();
-       assertEquals(BorderStyle.MEDIUM, cs.getBorderRight());
+       assertEquals(BorderStyle.MEDIUM, cs.getBorderRightEnum());
 
        cs = s.getRow(10).getCell(10).getCellStyle();
-       assertEquals(BorderStyle.THICK, cs.getBorderRight());
+       assertEquals(BorderStyle.THICK, cs.getBorderRightEnum());
 
        cs = s.getRow(11).getCell(11).getCellStyle();
-       assertEquals(BorderStyle.DOUBLE, cs.getBorderRight());
+       assertEquals(BorderStyle.DOUBLE, cs.getBorderRightEnum());
     }
 
     public void testShrinkToFit() {
@@ -500,7 +500,7 @@ public final class TestCellStyle extends TestCase {
         newCell.setCellValue("2testtext2");
 
         CellStyle newStyle = newCell.getCellStyle();
-        assertEquals(BorderStyle.DOTTED, newStyle.getBorderBottom());
+        assertEquals(BorderStyle.DOTTED, newStyle.getBorderBottomEnum());
         assertEquals(Font.COLOR_RED, ((HSSFCellStyle)newStyle).getFont(wb).getColor());
         
 //        OutputStream out = new FileOutputStream("/tmp/56959.xls");
index 059ab3f384d7b1f64601480508a449dac512239a..acb4974c11b5701d69052a37cfadd43cd0eb7691 100644 (file)
@@ -308,8 +308,8 @@ public final class TestHSSFOptimiser extends TestCase {
            // Check
            assertEquals(23, wb.getNumCellStyles());
            
-           assertEquals(BorderStyle.THICK, r.getCell(0).getCellStyle().getBorderBottom());
-           assertEquals(BorderStyle.DASH_DOT, r.getCell(1).getCellStyle().getBorderBottom());
-           assertEquals(BorderStyle.THICK, r.getCell(2).getCellStyle().getBorderBottom());
+           assertEquals(BorderStyle.THICK, r.getCell(0).getCellStyle().getBorderBottomEnum());
+           assertEquals(BorderStyle.DASH_DOT, r.getCell(1).getCellStyle().getBorderBottomEnum());
+           assertEquals(BorderStyle.THICK, r.getCell(2).getCellStyle().getBorderBottomEnum());
        }
 }
index ba65d063ac8928b0ae0c0e252539b4f36e46fd0f..35519d36cf943b8f93ebd90fbda70b89a82ca9c7 100644 (file)
@@ -151,10 +151,10 @@ public final class TestRowStyle extends TestCase {
             assertNotNull("Row is not null", r);
             
             cs = r.getRowStyle();
-            assertEquals("Bottom Border Style for row:", BorderStyle.THIN, cs.getBorderBottom());
-            assertEquals("Left Border Style for row:",   BorderStyle.THIN, cs.getBorderLeft());
-            assertEquals("Right Border Style for row:",  BorderStyle.THIN, cs.getBorderRight());
-            assertEquals("Top Border Style for row:",    BorderStyle.THIN, cs.getBorderTop());
+            assertEquals("Bottom Border Style for row:", BorderStyle.THIN, cs.getBorderBottomEnum());
+            assertEquals("Left Border Style for row:",   BorderStyle.THIN, cs.getBorderLeftEnum());
+            assertEquals("Right Border Style for row:",  BorderStyle.THIN, cs.getBorderRightEnum());
+            assertEquals("Top Border Style for row:",    BorderStyle.THIN, cs.getBorderTopEnum());
             assertEquals("FillForegroundColor for row:", 0xA, cs.getFillForegroundColor());
             assertEquals("FillPattern for row:",         0x1, cs.getFillPattern());
             
index 5ea2280b2ae8692673fa2dbc4adf926a287754d0..2fd2c37bf8b82da857e1624ceb49d8f4884012e0 100644 (file)
@@ -73,10 +73,10 @@ public class BaseTestBorderStyle {
     
     protected void assertBorderStyleEquals(BorderStyle expected, Cell cell) {
         CellStyle style = cell.getCellStyle();
-        assertEquals(expected, style.getBorderTop());
-        assertEquals(expected, style.getBorderBottom());
-        assertEquals(expected, style.getBorderLeft());
-        assertEquals(expected, style.getBorderRight());
+        assertEquals(expected, style.getBorderTopEnum());
+        assertEquals(expected, style.getBorderBottomEnum());
+        assertEquals(expected, style.getBorderLeftEnum());
+        assertEquals(expected, style.getBorderRightEnum());
     }
 
 }
index 406816958947fb05327bb3120a1b4d59c94da159..a19cf6684bc81eabd35d525d1ed1121aba01c90b 100644 (file)
@@ -278,10 +278,10 @@ public abstract class BaseTestCell {
 
         assertNotNull("Formula Cell Style", cs);
         assertEquals("Font Index Matches", f.getIndex(), cs.getFontIndex());
-        assertEquals("Top Border", BorderStyle.THIN, cs.getBorderTop());
-        assertEquals("Left Border", BorderStyle.THIN, cs.getBorderLeft());
-        assertEquals("Right Border", BorderStyle.THIN, cs.getBorderRight());
-        assertEquals("Bottom Border", BorderStyle.THIN, cs.getBorderBottom());
+        assertEquals("Top Border", BorderStyle.THIN, cs.getBorderTopEnum());
+        assertEquals("Left Border", BorderStyle.THIN, cs.getBorderLeftEnum());
+        assertEquals("Right Border", BorderStyle.THIN, cs.getBorderRightEnum());
+        assertEquals("Bottom Border", BorderStyle.THIN, cs.getBorderBottomEnum());
         wb2.close();
     }
 
index a63ce5a60558baa359eeb60737849caec316bc91..91c204da3285f0f4ca1d00d57d165e93f8b1d3c4 100644 (file)
@@ -99,11 +99,11 @@ public class BaseTestCellUtil {
 \r
         // A valid BorderStyle constant, as a Short\r
         CellUtil.setCellStyleProperty(c, CellUtil.BORDER_BOTTOM, BorderStyle.DASH_DOT.getCode());\r
-        assertEquals(BorderStyle.DASH_DOT, c.getCellStyle().getBorderBottom());\r
+        assertEquals(BorderStyle.DASH_DOT, c.getCellStyle().getBorderBottomEnum());\r
         \r
         // A valid BorderStyle constant, as an Enum\r
         CellUtil.setCellStyleProperty(c, CellUtil.BORDER_TOP, BorderStyle.MEDIUM_DASH_DOT);\r
-        assertEquals(BorderStyle.MEDIUM_DASH_DOT, c.getCellStyle().getBorderTop());\r
+        assertEquals(BorderStyle.MEDIUM_DASH_DOT, c.getCellStyle().getBorderTopEnum());\r
         \r
         wb.close();\r
     }\r