poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fannin...@apache.org
Subject svn commit: r1812907 - in /poi/trunk/src: examples/src/org/apache/poi/hssf/view/ examples/src/org/apache/poi/ss/examples/ examples/src/org/apache/poi/ss/examples/html/ java/org/apache/poi/hssf/usermodel/ java/org/apache/poi/ss/usermodel/ java/org/apach...
Date Sun, 22 Oct 2017 12:45:36 GMT
Author: fanningpj
Date: Sun Oct 22 12:45:35 2017
New Revision: 1812907

URL: http://svn.apache.org/viewvc?rev=1812907&view=rev
Log:
Remove use of deprecated methods

Modified:
    poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
    poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java
    poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
    poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java
    poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/CellStyle.java
    poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java
    poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
    poi/trunk/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java Sun Oct 22 12:45:35 2017
@@ -156,7 +156,7 @@ public class SVTableCellEditor extends A
           Font font = new Font(f.getFontName(),fontstyle,fontheight);
           editor.setFont(font);
 
-          if (style.getFillPatternEnum() == FillPatternType.SOLID_FOREGROUND) {
+          if (style.getFillPattern() == FillPatternType.SOLID_FOREGROUND) {
             editor.setBackground(getAWTColor(style.getFillForegroundColor(), white));
           } else {
             editor.setBackground(white);
@@ -187,7 +187,7 @@ public class SVTableCellEditor extends A
         default:
           editor.setText("?");
       }
-      switch (style.getAlignmentEnum()) {
+      switch (style.getAlignment()) {
         case LEFT:
         case JUSTIFY:
         case FILL:

Modified: poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java Sun Oct 22 12:45:35 2017
@@ -151,7 +151,7 @@ public class SVTableCellRenderer extends
           HSSFFont f = wb.getFontAt(s.getFontIndex());
           setFont(SVTableUtils.makeFont(f));
 
-          if (s.getFillPatternEnum() == FillPatternType.SOLID_FOREGROUND) {
+          if (s.getFillPattern() == FillPatternType.SOLID_FOREGROUND) {
             setBackground(SVTableUtils.getAWTColor(s.getFillForegroundColor(), SVTableUtils.white));
           } else setBackground(SVTableUtils.white);
 
@@ -195,7 +195,7 @@ public class SVTableCellRenderer extends
                 setValue("?");
             }
             //Set the text alignment of the cell
-            switch (s.getAlignmentEnum()) {
+            switch (s.getAlignment()) {
               case LEFT:
               case JUSTIFY:
               case FILL:

Modified: poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java Sun Oct 22 12:45:35 2017
@@ -330,8 +330,8 @@ public class ExcelComparator {
      */
     private void isCellAlignmentMatches(Locator loc1, Locator loc2) {
         // TODO: check for NPE
-        HorizontalAlignment align1 = loc1.cell.getCellStyle().getAlignmentEnum();
-        HorizontalAlignment align2 = loc2.cell.getCellStyle().getAlignmentEnum();
+        HorizontalAlignment align1 = loc1.cell.getCellStyle().getAlignment();
+        HorizontalAlignment align2 = loc2.cell.getCellStyle().getAlignment();
         if (align1 != align2) {
             addMessage(loc1, loc2,
                 "Cell Alignment does not Match ::",
@@ -460,8 +460,8 @@ public class ExcelComparator {
      */
     private void isCellFillPatternMatches(Locator loc1, Locator loc2) {
         // TOOO: Check for NPE
-        FillPatternType fill1 = loc1.cell.getCellStyle().getFillPatternEnum();
-        FillPatternType fill2 = loc2.cell.getCellStyle().getFillPatternEnum();
+        FillPatternType fill1 = loc1.cell.getCellStyle().getFillPattern();
+        FillPatternType fill2 = loc2.cell.getCellStyle().getFillPattern();
         if (fill1 != fill2) {
             addMessage(loc1, loc2,
                 "Cell Fill pattern does not Match ::",

Modified: poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java Sun Oct 22 12:45:35 2017
@@ -44,7 +44,7 @@ public class HSSFHtmlHelper implements H
     @Override
     public void colorStyles(CellStyle style, Formatter out) {
         HSSFCellStyle cs = (HSSFCellStyle) style;
-        out.format("  /* fill pattern = %d */%n", cs.getFillPatternEnum().getCode());
+        out.format("  /* fill pattern = %d */%n", cs.getFillPattern().getCode());
         styleColor(out, "background-color", cs.getFillForegroundColor());
         styleColor(out, "color", cs.getFont(wb).getColor());
         styleColor(out, "border-left-color", cs.getLeftBorderColor());

Modified: poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java Sun Oct 22 12:45:35 2017
@@ -289,8 +289,8 @@ public class ToHtml {
     }
 
     private void styleContents(CellStyle style) {
-        styleOut("text-align", style.getAlignmentEnum(), HALIGN);
-        styleOut("vertical-align", style.getVerticalAlignmentEnum(), VALIGN);
+        styleOut("text-align", style.getAlignment(), HALIGN);
+        styleOut("vertical-align", style.getVerticalAlignment(), VALIGN);
         fontStyle(style);
         borderStyles(style);
         helper.colorStyles(style, out);
@@ -493,7 +493,7 @@ public class ToHtml {
     }
 
     private String tagStyle(Cell cell, CellStyle style) {
-        if (style.getAlignmentEnum() == HorizontalAlignment.GENERAL) {
+        if (style.getAlignment() == HorizontalAlignment.GENERAL) {
             switch (ultimateCellType(cell)) {
             case STRING:
                 return "style=\"text-align: left;\"";

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java Sun Oct 22 12:45:35 2017
@@ -272,25 +272,16 @@ public final class HSSFCellStyle impleme
         _format.setAlignment(align.getCode());
     }
 
-    /**
-     * get the type of horizontal alignment for the cell
-     * @return align - the type of alignment
-     * @deprecated POI 3.15 beta 3. Use {@link #getAlignmentEnum()} instead.
-     */
-    @Deprecated
     @Override
-    public short getAlignment()
+    public HorizontalAlignment getAlignment()
     {
-        return _format.getAlignment();
+        return HorizontalAlignment.forInt(_format.getAlignment());
     }
-    /**
-     * get the type of horizontal alignment for the cell
-     * @return align - the type of alignment
-     */
+
     @Override
     public HorizontalAlignment getAlignmentEnum()
     {
-        return HorizontalAlignment.forInt(_format.getAlignment());
+        return getAlignment();
     }
 
     /**
@@ -324,27 +315,15 @@ public final class HSSFCellStyle impleme
         _format.setVerticalAlignment(align.getCode());
     }
 
-    /**
-     * get the type of vertical alignment for the cell
-     * @return align the type of alignment
-     * @see VerticalAlignment
-     * @deprecated POI 3.15 beta 3. Use {@link #getVerticalAlignmentEnum()} instead.
-     */
-    @Deprecated
     @Override
-    public short getVerticalAlignment()
-    {
-        return _format.getVerticalAlignment();
+    public VerticalAlignment getVerticalAlignment() {
+        return VerticalAlignment.forInt(_format.getVerticalAlignment());
+    }
+
+    @Override
+    public VerticalAlignment getVerticalAlignmentEnum() {
+        return getVerticalAlignment();
     }
-   /**
-    * get the type of vertical alignment for the cell
-    * @return align the type of alignment
-    */
-   @Override
-   public VerticalAlignment getVerticalAlignmentEnum()
-   {
-       return VerticalAlignment.forInt(_format.getVerticalAlignment());
-   }
 
     /**
      * set the degree of rotation for the text in the cell
@@ -649,28 +628,15 @@ public final class HSSFCellStyle impleme
         _format.setAdtlFillPattern(fp.getCode());
     }
 
-    /**
-     * get the fill pattern
-     * @return fill pattern
-     * @deprecated POI 3.15 beta 3. This method will return {@link FillPatternType} in the future. Use {@link #setFillPattern(FillPatternType)} instead. 
-     */
-    @Deprecated
     @Override
-    public short getFillPattern()
-    {
-        return getFillPatternEnum().getCode();
-    }
-    
-    /**
-     * get the fill pattern
-     * @return fill pattern
-     */
-    @Override
-    public FillPatternType getFillPatternEnum()
+    public FillPatternType getFillPattern()
     {
         return FillPatternType.forInt(_format.getAdtlFillPattern());
     }
 
+    @Override
+    public FillPatternType getFillPatternEnum() { return getFillPattern(); }
+
     /**
      * Checks if the background and foreground fills are set correctly when one
      * or the other is set to the default color.

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/CellStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/CellStyle.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/CellStyle.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/CellStyle.java Sun Oct 22 12:45:35 2017
@@ -17,6 +17,8 @@
 
 package org.apache.poi.ss.usermodel;
 
+import org.apache.poi.util.Removal;
+
 public interface CellStyle {
 
     /**
@@ -113,13 +115,15 @@ public interface CellStyle {
     /**
      * get the type of horizontal alignment for the cell
      * @return align - the type of alignment
-     * @deprecated POI 3.15 beta 3. Use {@link #getAlignmentEnum()} instead.
      */
-    short getAlignment();
+    HorizontalAlignment getAlignment();
+
     /**
      * get the type of horizontal alignment for the cell
      * @return align - the type of alignment
+     * @deprecated use <code>getAlignment()</code> instead
      */
+    @Removal(version = "4.2")
     HorizontalAlignment getAlignmentEnum();
 
     /**
@@ -129,14 +133,12 @@ public interface CellStyle {
      *
      * @param wrapped  wrap text or not
      */
-
     void setWrapText(boolean wrapped);
 
     /**
      * get whether the text should be wrapped
      * @return wrap text or not
      */
-
     boolean getWrapText();
 
     /**
@@ -148,13 +150,15 @@ public interface CellStyle {
     /**
      * get the type of vertical alignment for the cell
      * @return align the type of alignment
-     * @deprecated POI 3.15 beta 3. Use {@link #getVerticalAlignmentEnum()} instead.
      */
-    short getVerticalAlignment();
+    VerticalAlignment getVerticalAlignment();
+
     /**
      * get the type of vertical alignment for the cell
      * @return align the type of alignment
+     * @deprecated use <code>getVerticalAlignment()</code> instead
      */
+    @Removal(version = "4.2")
     VerticalAlignment getVerticalAlignmentEnum();
 
     /**
@@ -335,16 +339,21 @@ public interface CellStyle {
     void setFillPattern(FillPatternType fp);
 
     /**
-     * get the fill pattern (??) - set to 1 to fill with foreground color
-     * @return fill pattern
-     * @deprecated POI 3.15 beta 3. This method will return {@link FillPatternType} in the future. Use {@link #setFillPattern(FillPatternType)} instead.
+     * Get the fill pattern
+     *
+     * @return the fill pattern, default value is {@link FillPatternType#NO_FILL}
+     * @since POI 4.0.0
      */
-    short getFillPattern();
+    FillPatternType getFillPattern();
+
     /**
-     * get the fill pattern (??) - set to 1 to fill with foreground color
-     * @return fill pattern
+     * Get the fill pattern
+     *
+     * @return the fill pattern, default value is {@link FillPatternType#NO_FILL}
      * @since POI 3.15 beta 3
+     * @deprecated use <code>getFillPattern()</code> instead
      */
+    @Removal(version = "4.2")
     FillPatternType getFillPatternEnum();
 
     /**
@@ -352,7 +361,6 @@ public interface CellStyle {
      *
      * @param bg  color
      */
-
     void setFillBackgroundColor(short bg);
 
     /**

Modified: poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java Sun Oct 22 12:45:35 2017
@@ -335,15 +335,15 @@ public final class CellUtil {
      */
     private static Map<String, Object> getFormatProperties(CellStyle style) {
         Map<String, Object> properties = new HashMap<>();
-        put(properties, ALIGNMENT, style.getAlignmentEnum());
-        put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignmentEnum());
+        put(properties, ALIGNMENT, style.getAlignment());
+        put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignment());
         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());
+        put(properties, FILL_PATTERN, style.getFillPattern());
         put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
         put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
         put(properties, FONT, style.getFontIndex());

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java Sun Oct 22 12:45:35 2017
@@ -217,24 +217,8 @@ public class XSSFCellStyle implements Ce
         _cellXf.setApplyBorder(true);
     }
 
-    /**
-     * Get the type of horizontal alignment for the cell
-     *
-     * @return short - the type of alignment
-     * @deprecated POI 3.15 beta 3. Use {@link #getAlignmentEnum()} instead.
-     */
     @Override
-    public short getAlignment() {
-        return getAlignmentEnum().getCode();
-    }
-
-    /**
-     * Get the type of horizontal alignment for the cell
-     *
-     * @return HorizontalAlignment - the type of alignment
-     */
-    @Override
-    public HorizontalAlignment getAlignmentEnum() {
+    public HorizontalAlignment getAlignment() {
         CTCellAlignment align = _cellXf.getAlignment();
         if(align != null && align.isSetHorizontal()) {
             return HorizontalAlignment.forInt(align.getHorizontal().intValue()-1);
@@ -242,6 +226,10 @@ public class XSSFCellStyle implements Ce
         return HorizontalAlignment.GENERAL;
     }
 
+    @Override
+    public HorizontalAlignment getAlignmentEnum() {
+        return getAlignment();
+    }
     /**
      * Get the type of border to use for the bottom border of the cell
      * Will be removed when {@link #getBorderBottom()} returns a BorderStyle enum
@@ -494,24 +482,9 @@ public class XSSFCellStyle implements Ce
         return fillForegroundColor;
     }
 
-    /**
-     * Get the fill pattern
-     * @return fill pattern, default value is the code for {@link org.apache.poi.ss.usermodel.FillPatternType#NO_FILL}
-     * @deprecated POI 3.15 beta 3. This method will return {@link FillPatternType} in the future. Use {@link #setFillPattern(FillPatternType)} instead.
-     */
-    @Override
-    public short getFillPattern() {
-        return getFillPatternEnum().getCode();
-    }
-
-    /**
-     * Get the fill pattern
-     *
-     * @return the fill pattern, default value is {@link FillPatternType#NO_FILL}
-     */
     @Override
-    public FillPatternType getFillPatternEnum() {
-     // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
+    public FillPatternType getFillPattern() {
+        // bug 56295: handle missing applyFill attribute as "true" because Excel does as well
         if(_cellXf.isSetApplyFill() && !_cellXf.getApplyFill()) return FillPatternType.NO_FILL;
 
         int fillIndex = (int)_cellXf.getFillId();
@@ -522,10 +495,15 @@ public class XSSFCellStyle implements Ce
         return FillPatternType.forInt(ptrn.intValue() - 1);
     }
 
+    @Override
+    public FillPatternType getFillPatternEnum() {
+        return getFillPattern();
+    }
+
     /**
-    * Gets the font for this style
-    * @return Font - font
-    */
+     * Gets the font for this style
+     * @return Font - font
+     */
     public XSSFFont getFont() {
         if (_font == null) {
             _font = _stylesSource.getFontAt(getFontId());
@@ -708,24 +686,8 @@ public class XSSFCellStyle implements Ce
         return border.getBorderColor(BorderSide.TOP);
     }
 
-    /**
-     * Get the type of vertical alignment for the cell
-     *
-     * @return align the type of alignment, default value is {@link org.apache.poi.ss.usermodel.VerticalAlignment}
-     * @deprecated POI 3.15 beta 3. Use {@link #getVerticalAlignmentEnum()} instead.
-     */
     @Override
-    public short getVerticalAlignment() {
-        return getVerticalAlignmentEnum().getCode();
-    }
-
-    /**
-     * Get the type of vertical alignment for the cell
-     *
-     * @return the type of alignment, default value is {@link VerticalAlignment#BOTTOM}
-     */
-    @Override
-    public VerticalAlignment getVerticalAlignmentEnum() {
+    public VerticalAlignment getVerticalAlignment() {
         CTCellAlignment align = _cellXf.getAlignment();
         if(align != null && align.isSetVertical()) {
             return VerticalAlignment.forInt(align.getVertical().intValue()-1);
@@ -733,6 +695,11 @@ public class XSSFCellStyle implements Ce
         return VerticalAlignment.BOTTOM;
     }
 
+    @Override
+    public VerticalAlignment getVerticalAlignmentEnum() {
+        return getVerticalAlignment();
+    }
+
     /**
      * Whether the text should be wrapped
      *

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java Sun Oct 22 12:45:35 2017
@@ -555,7 +555,7 @@ public class TestXSSFCellStyle {
         HSSFCellStyle style2 = wb2.createCellStyle();
         assertEquals(style2.getFillBackgroundColor(), style1.getFillBackgroundColor());
         assertEquals(style2.getFillForegroundColor(), style1.getFillForegroundColor());
-        assertEquals(style2.getFillPatternEnum(), style1.getFillPatternEnum());
+        assertEquals(style2.getFillPattern(), style1.getFillPattern());
         assertEquals(style2.getFillPattern(), style1.getFillPattern());
 
         assertEquals(style2.getLeftBorderColor(), style1.getLeftBorderColor());
@@ -570,7 +570,6 @@ public class TestXSSFCellStyle {
         wb2.close();
 	}
 
-	@SuppressWarnings("deprecation")
     @Test
     public void testGetFillForegroundColor() throws IOException {
         XSSFWorkbook wb = new XSSFWorkbook();
@@ -581,14 +580,12 @@ public class TestXSSFCellStyle {
         XSSFCellStyle defaultStyle = wb.getCellStyleAt((short)0);
         assertEquals(IndexedColors.AUTOMATIC.getIndex(), defaultStyle.getFillForegroundColor());
         assertEquals(null, defaultStyle.getFillForegroundXSSFColor());
-        assertEquals(FillPatternType.NO_FILL, defaultStyle.getFillPatternEnum());
-        assertEquals(FillPatternType.NO_FILL.getCode(), defaultStyle.getFillPattern());
+        assertEquals(FillPatternType.NO_FILL, defaultStyle.getFillPattern());
 
         XSSFCellStyle customStyle = wb.createCellStyle();
 
         customStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-        assertEquals(FillPatternType.SOLID_FOREGROUND, customStyle.getFillPatternEnum());
-        assertEquals(FillPatternType.SOLID_FOREGROUND.getCode(), customStyle.getFillPattern());
+        assertEquals(FillPatternType.SOLID_FOREGROUND, customStyle.getFillPattern());
         assertEquals(3, styles.getFills().size());
 
         customStyle.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex());
@@ -599,8 +596,7 @@ public class TestXSSFCellStyle {
             XSSFCellStyle style = wb.createCellStyle();
 
             style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-            assertEquals(FillPatternType.SOLID_FOREGROUND, style.getFillPatternEnum());
-            assertEquals(FillPatternType.SOLID_FOREGROUND.getCode(), style.getFillPattern());
+            assertEquals(FillPatternType.SOLID_FOREGROUND, style.getFillPattern());
             assertEquals(4, styles.getFills().size());
 
             style.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex());
@@ -612,17 +608,14 @@ public class TestXSSFCellStyle {
         wb.close();
     }
 
-    @SuppressWarnings("deprecation")
     @Test
     public void testGetFillPattern() {
 
-        assertEquals(STPatternType.INT_DARK_GRAY-1, cellStyle.getFillPatternEnum().getCode());
-        assertEquals(STPatternType.INT_DARK_GRAY-1, cellStyle.getFillPattern());
+        assertEquals(STPatternType.INT_DARK_GRAY-1, cellStyle.getFillPattern().getCode());
 
         int num = stylesTable.getFills().size();
         cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-        assertEquals(FillPatternType.SOLID_FOREGROUND, cellStyle.getFillPatternEnum());
-        assertEquals(FillPatternType.SOLID_FOREGROUND.getCode(), cellStyle.getFillPattern());
+        assertEquals(FillPatternType.SOLID_FOREGROUND, cellStyle.getFillPattern());
         assertEquals(num + 1, stylesTable.getFills().size());
         int fillId = (int)cellStyle.getCoreXf().getFillId();
         assertTrue(fillId > 0);
@@ -637,8 +630,7 @@ public class TestXSSFCellStyle {
         assertEquals(num + 1, stylesTable.getFills().size());
 
         cellStyle.setFillPattern(FillPatternType.NO_FILL);
-        assertEquals(FillPatternType.NO_FILL, cellStyle.getFillPatternEnum());
-        assertEquals(FillPatternType.NO_FILL.getCode(), cellStyle.getFillPattern());
+        assertEquals(FillPatternType.NO_FILL, cellStyle.getFillPattern());
         fillId = (int)cellStyle.getCoreXf().getFillId();
         ctFill2 = stylesTable.getFillAt(fillId).getCTFill();
         assertFalse(ctFill2.getPatternFill().isSetPatternType());
@@ -677,25 +669,21 @@ public class TestXSSFCellStyle {
 		assertEquals((short)13, cellStyle.getIndention());
 	}
 
-	@SuppressWarnings("deprecation")
     @Test
     public void testGetSetAlignment() {
 		assertNull(cellStyle.getCellAlignment().getCTCellAlignment().getHorizontal());
-		assertEquals(HorizontalAlignment.GENERAL, cellStyle.getAlignmentEnum());
+		assertEquals(HorizontalAlignment.GENERAL, cellStyle.getAlignment());
 
 		cellStyle.setAlignment(HorizontalAlignment.LEFT);
-		assertEquals(HorizontalAlignment.LEFT.getCode(), cellStyle.getAlignment());
-		assertEquals(HorizontalAlignment.LEFT, cellStyle.getAlignmentEnum());
+		assertEquals(HorizontalAlignment.LEFT, cellStyle.getAlignment());
 		assertEquals(STHorizontalAlignment.LEFT, cellStyle.getCellAlignment().getCTCellAlignment().getHorizontal());
 
 		cellStyle.setAlignment(HorizontalAlignment.JUSTIFY);
-		assertEquals(HorizontalAlignment.JUSTIFY.getCode(), cellStyle.getAlignment());
-		assertEquals(HorizontalAlignment.JUSTIFY, cellStyle.getAlignmentEnum());
+		assertEquals(HorizontalAlignment.JUSTIFY, cellStyle.getAlignment());
 		assertEquals(STHorizontalAlignment.JUSTIFY, cellStyle.getCellAlignment().getCTCellAlignment().getHorizontal());
 
 		cellStyle.setAlignment(HorizontalAlignment.CENTER);
-		assertEquals(HorizontalAlignment.CENTER.getCode(), cellStyle.getAlignment());
-		assertEquals(HorizontalAlignment.CENTER, cellStyle.getAlignmentEnum());
+		assertEquals(HorizontalAlignment.CENTER, cellStyle.getAlignment());
 		assertEquals(STHorizontalAlignment.CENTER, cellStyle.getCellAlignment().getCTCellAlignment().getHorizontal());
 	}
 	
@@ -717,21 +705,17 @@ public class TestXSSFCellStyle {
         assertEquals(ReadingOrder.CONTEXT.getCode(), cellStyle.getCellAlignment().getCTCellAlignment().getReadingOrder());
     }
 
-	@SuppressWarnings("deprecation")
     @Test
     public void testGetSetVerticalAlignment() {
-		assertEquals(VerticalAlignment.BOTTOM, cellStyle.getVerticalAlignmentEnum());
-		assertEquals(VerticalAlignment.BOTTOM.getCode(), cellStyle.getVerticalAlignment());
+		assertEquals(VerticalAlignment.BOTTOM, cellStyle.getVerticalAlignment());
 		assertNull(cellStyle.getCellAlignment().getCTCellAlignment().getVertical());
 
 		cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
-		assertEquals(VerticalAlignment.CENTER.getCode(), cellStyle.getVerticalAlignment());
-		assertEquals(VerticalAlignment.CENTER, cellStyle.getVerticalAlignmentEnum());
+		assertEquals(VerticalAlignment.CENTER, cellStyle.getVerticalAlignment());
 		assertEquals(STVerticalAlignment.CENTER, cellStyle.getCellAlignment().getCTCellAlignment().getVertical());
 
 		cellStyle.setVerticalAlignment(VerticalAlignment.JUSTIFY);
-		assertEquals(VerticalAlignment.JUSTIFY.getCode(), cellStyle.getVerticalAlignment());
-		assertEquals(VerticalAlignment.JUSTIFY, cellStyle.getVerticalAlignmentEnum());
+		assertEquals(VerticalAlignment.JUSTIFY, cellStyle.getVerticalAlignment());
 		assertEquals(STVerticalAlignment.JUSTIFY, cellStyle.getCellAlignment().getCTCellAlignment().getVertical());
 	}
 
@@ -761,17 +745,17 @@ public class TestXSSFCellStyle {
       orig.setFont(fnt);
       orig.setDataFormat((short)18);
       
-      assertEquals(HorizontalAlignment.RIGHT, orig.getAlignmentEnum());
+      assertEquals(HorizontalAlignment.RIGHT, orig.getAlignment());
       assertEquals(fnt, orig.getFont());
       assertEquals(18, orig.getDataFormat());
       
       XSSFCellStyle clone = wb.createCellStyle();
-      assertFalse(HorizontalAlignment.RIGHT == clone.getAlignmentEnum());
+      assertFalse(HorizontalAlignment.RIGHT == clone.getAlignment());
       assertFalse(fnt == clone.getFont());
       assertFalse(18 == clone.getDataFormat());
       
       clone.cloneStyleFrom(orig);
-      assertEquals(HorizontalAlignment.RIGHT, clone.getAlignmentEnum());
+      assertEquals(HorizontalAlignment.RIGHT, clone.getAlignment());
       assertEquals(fnt, clone.getFont());
       assertEquals(18, clone.getDataFormat());
       assertEquals(2, wb.getNumberOfFonts());
@@ -806,7 +790,7 @@ public class TestXSSFCellStyle {
        orig.setFont(fnt);
        orig.setDataFormat(fmt.getFormat("Test##"));
        
-       assertTrue(HorizontalAlignment.RIGHT == orig.getAlignmentEnum());
+       assertTrue(HorizontalAlignment.RIGHT == orig.getAlignment());
        assertTrue(fnt == orig.getFont());
        assertTrue(fmt.getFormat("Test##") == orig.getDataFormat());
        
@@ -826,7 +810,7 @@ public class TestXSSFCellStyle {
        assertEquals(1, wbClone.getNumberOfFonts());
        assertEquals(0, wbClone.getStylesSource().getNumberFormats().size());
        
-       assertFalse(HorizontalAlignment.RIGHT == clone.getAlignmentEnum());
+       assertFalse(HorizontalAlignment.RIGHT == clone.getAlignment());
        assertNotEquals("TestingFont", clone.getFont().getFontName());
        
        clone.cloneStyleFrom(orig);
@@ -835,7 +819,7 @@ public class TestXSSFCellStyle {
        assertEquals(2, wbClone.getNumCellStyles());
        assertEquals(1, wbClone.getStylesSource().getNumberFormats().size());
        
-       assertEquals(HorizontalAlignment.RIGHT, clone.getAlignmentEnum());
+       assertEquals(HorizontalAlignment.RIGHT, clone.getAlignment());
        assertEquals("TestingFont", clone.getFont().getFontName());
        assertEquals(fmtClone.getFormat("Test##"), clone.getDataFormat());
        assertFalse(fmtClone.getFormat("Test##") == fmt.getFormat("Test##"));
@@ -847,7 +831,7 @@ public class TestXSSFCellStyle {
        assertEquals(1, wbReload.getStylesSource().getNumberFormats().size());
        
        XSSFCellStyle reload = wbReload.getCellStyleAt((short)1);
-       assertEquals(HorizontalAlignment.RIGHT, reload.getAlignmentEnum());
+       assertEquals(HorizontalAlignment.RIGHT, reload.getAlignment());
        assertEquals("TestingFont", reload.getFont().getFontName());
        assertEquals(fmtClone.getFormat("Test##"), reload.getDataFormat());
        assertFalse(fmtClone.getFormat("Test##") == fmt.getFormat("Test##"));
@@ -951,42 +935,38 @@ public class TestXSSFCellStyle {
     
     @Test
     public void testSetColor() throws IOException {
-        Workbook wb = new XSSFWorkbook();
-        Sheet sheet = wb.createSheet();
-        Row row = sheet.createRow(0);
-        
-        DataFormat format = wb.createDataFormat();
-        Cell cell = row.createCell(1);
-        cell.setCellValue("somevalue");
-        CellStyle cellStyle2 = wb.createCellStyle();
-
-
-        cellStyle2.setDataFormat(format.getFormat("###0"));
-
-        cellStyle2.setFillBackgroundColor(IndexedColors.DARK_BLUE.getIndex());
-        cellStyle2.setFillForegroundColor(IndexedColors.DARK_BLUE.getIndex());
-        cellStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-
-        cellStyle2.setAlignment(HorizontalAlignment.RIGHT);
-        cellStyle2.setVerticalAlignment(VerticalAlignment.TOP);
-
-        cell.setCellStyle(cellStyle2);
-
-        Workbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
-        Cell cellBack = wbBack.getSheetAt(0).getRow(0).getCell(1);
-        assertNotNull(cellBack);
-        CellStyle styleBack = cellBack.getCellStyle();
-        assertEquals(IndexedColors.DARK_BLUE.getIndex(), styleBack.getFillBackgroundColor());
-        assertEquals(IndexedColors.DARK_BLUE.getIndex(), styleBack.getFillForegroundColor());
-        assertEquals(HorizontalAlignment.RIGHT, styleBack.getAlignmentEnum());
-        assertEquals(VerticalAlignment.TOP, styleBack.getVerticalAlignmentEnum());
-        assertEquals(FillPatternType.SOLID_FOREGROUND, styleBack.getFillPatternEnum());
-        //noinspection deprecation
-        assertEquals(FillPatternType.SOLID_FOREGROUND.getCode(), styleBack.getFillPattern());
-        
-        wbBack.close();
-        
-        wb.close();
+        try(Workbook wb = new XSSFWorkbook()) {
+            Sheet sheet = wb.createSheet();
+            Row row = sheet.createRow(0);
+
+            DataFormat format = wb.createDataFormat();
+            Cell cell = row.createCell(1);
+            cell.setCellValue("somevalue");
+            CellStyle cellStyle2 = wb.createCellStyle();
+
+
+            cellStyle2.setDataFormat(format.getFormat("###0"));
+
+            cellStyle2.setFillBackgroundColor(IndexedColors.DARK_BLUE.getIndex());
+            cellStyle2.setFillForegroundColor(IndexedColors.DARK_BLUE.getIndex());
+            cellStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+
+            cellStyle2.setAlignment(HorizontalAlignment.RIGHT);
+            cellStyle2.setVerticalAlignment(VerticalAlignment.TOP);
+
+            cell.setCellStyle(cellStyle2);
+
+            try (Workbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb)) {
+                Cell cellBack = wbBack.getSheetAt(0).getRow(0).getCell(1);
+                assertNotNull(cellBack);
+                CellStyle styleBack = cellBack.getCellStyle();
+                assertEquals(IndexedColors.DARK_BLUE.getIndex(), styleBack.getFillBackgroundColor());
+                assertEquals(IndexedColors.DARK_BLUE.getIndex(), styleBack.getFillForegroundColor());
+                assertEquals(HorizontalAlignment.RIGHT, styleBack.getAlignment());
+                assertEquals(VerticalAlignment.TOP, styleBack.getVerticalAlignment());
+                assertEquals(FillPatternType.SOLID_FOREGROUND, styleBack.getFillPattern());
+            }
+        }
     }
 
     public static void copyStyles(Workbook reference, Workbook target) {
@@ -1070,7 +1050,7 @@ public class TestXSSFCellStyle {
         assertNull(cellStyle.getFillBackgroundColorColor());
 
         cellStyle.setFillPattern(FillPatternType.NO_FILL);
-        assertEquals(FillPatternType.NO_FILL, cellStyle.getFillPatternEnum());
+        assertEquals(FillPatternType.NO_FILL, cellStyle.getFillPattern());
 
         cellStyle.setBottomBorderColor(null);
         assertNull(cellStyle.getBottomBorderXSSFColor());

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java Sun Oct 22 12:45:35 2017
@@ -195,7 +195,7 @@ public class ExcelToFoConverter extends
      */
     protected boolean isEmptyStyle( CellStyle cellStyle ) {
         return cellStyle == null || (
-               cellStyle.getFillPattern() == 0
+               cellStyle.getFillPattern() == FillPatternType.NO_FILL
             && cellStyle.getBorderTopEnum() == BorderStyle.NONE
             && cellStyle.getBorderRightEnum() == BorderStyle.NONE
             && cellStyle.getBorderBottomEnum() == BorderStyle.NONE
@@ -336,16 +336,16 @@ public class ExcelToFoConverter extends
     {
         blockTarget.setAttribute( "white-space-collapse", "false" );
         {
-            String textAlign = ExcelToFoUtils.getAlign( cellStyle.getAlignmentEnum() );
+            String textAlign = ExcelToFoUtils.getAlign( cellStyle.getAlignment() );
             if ( ExcelToFoUtils.isNotEmpty( textAlign ) )
                 blockTarget.setAttribute( "text-align", textAlign );
         }
 
-        if ( cellStyle.getFillPatternEnum() == FillPatternType.NO_FILL )
+        if ( cellStyle.getFillPattern() == FillPatternType.NO_FILL )
         {
             // no fill
         }
-        else if ( cellStyle.getFillPatternEnum() == FillPatternType.SOLID_FOREGROUND )
+        else if ( cellStyle.getFillPattern() == FillPatternType.SOLID_FOREGROUND )
         {
             final HSSFColor foregroundColor = cellStyle
                     .getFillForegroundColorColor();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java Sun Oct 22 12:45:35 2017
@@ -190,9 +190,9 @@ public class ExcelToHtmlConverter extend
         StringBuilder style = new StringBuilder();
 
         style.append( "white-space:pre-wrap;" );
-        ExcelToHtmlUtils.appendAlign( style, cellStyle.getAlignmentEnum() );
+        ExcelToHtmlUtils.appendAlign( style, cellStyle.getAlignment() );
 
-        switch (cellStyle.getFillPatternEnum()) {
+        switch (cellStyle.getFillPattern()) {
             // no fill
             case NO_FILL: break;
             case SOLID_FOREGROUND:
@@ -444,7 +444,7 @@ public class ExcelToHtmlConverter extend
             innerDivStyle.append( "overflow:hidden;max-height:" );
             innerDivStyle.append( normalHeightPt );
             innerDivStyle.append( "pt;white-space:nowrap;" );
-            ExcelToHtmlUtils.appendAlign( innerDivStyle, cellStyle.getAlignmentEnum() );
+            ExcelToHtmlUtils.appendAlign( innerDivStyle, cellStyle.getAlignment() );
             htmlDocumentFacade.addStyleClass( outerDiv, cssClassPrefixDiv,
                     innerDivStyle.toString() );
 

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java Sun Oct 22 12:45:35 2017
@@ -232,17 +232,17 @@ public final class TestCellStyle extends
         orig.setFont(fnt);
         orig.setDataFormat((short)18);
         
-        assertEquals(HorizontalAlignment.JUSTIFY, orig.getAlignmentEnum());
+        assertEquals(HorizontalAlignment.JUSTIFY, orig.getAlignment());
         assertEquals(fnt, orig.getFont(wb));
         assertEquals(18, orig.getDataFormat());
         
         HSSFCellStyle clone = wb.createCellStyle();
-        assertFalse(HorizontalAlignment.RIGHT == clone.getAlignmentEnum());
+        assertFalse(HorizontalAlignment.RIGHT == clone.getAlignment());
         assertFalse(fnt == clone.getFont(wb));
         assertFalse(18 == clone.getDataFormat());
         
         clone.cloneStyleFrom(orig);
-        assertEquals(HorizontalAlignment.JUSTIFY, clone.getAlignmentEnum());
+        assertEquals(HorizontalAlignment.JUSTIFY, clone.getAlignment());
         assertEquals(fnt, clone.getFont(wb));
         assertEquals(18, clone.getDataFormat());
         assertEquals(5, wb.getNumberOfFonts());
@@ -268,7 +268,7 @@ public final class TestCellStyle extends
         orig.setFont(fnt);
         orig.setDataFormat(fmt.getFormat("Test##"));
         
-        assertEquals(HorizontalAlignment.RIGHT, orig.getAlignmentEnum());
+        assertEquals(HorizontalAlignment.RIGHT, orig.getAlignment());
         assertEquals(fnt, orig.getFont(wbOrig));
         assertEquals(fmt.getFormat("Test##"), orig.getDataFormat());
         
@@ -280,11 +280,11 @@ public final class TestCellStyle extends
         HSSFCellStyle clone = wbClone.createCellStyle();
         assertEquals(4, wbClone.getNumberOfFonts());
         
-        assertFalse(HorizontalAlignment.RIGHT == clone.getAlignmentEnum());
+        assertFalse(HorizontalAlignment.RIGHT == clone.getAlignment());
         assertFalse("TestingFont" == clone.getFont(wbClone).getFontName());
         
         clone.cloneStyleFrom(orig);
-        assertEquals(HorizontalAlignment.RIGHT, clone.getAlignmentEnum());
+        assertEquals(HorizontalAlignment.RIGHT, clone.getAlignment());
         assertEquals("TestingFont", clone.getFont(wbClone).getFontName());
         assertEquals(fmtClone.getFormat("Test##"), clone.getDataFormat());
         assertFalse(fmtClone.getFormat("Test##") == fmt.getFormat("Test##"));

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java Sun Oct 22 12:45:35 2017
@@ -103,7 +103,7 @@ public final class TestHSSFPalette {
         assertEquals(64, cellA.getCellStyle().getFillForegroundColor());
         assertEquals(64, cellA.getCellStyle().getFillBackgroundColor());
         assertEquals(Font.COLOR_NORMAL, cellA.getCellStyle().getFont(book).getColor());
-        assertEquals(FillPatternType.NO_FILL, cellA.getCellStyle().getFillPatternEnum());
+        assertEquals(FillPatternType.NO_FILL, cellA.getCellStyle().getFillPattern());
         assertEquals("0:0:0", p.getColor((short)64).getHexString());
         assertEquals(null, p.getColor((short)32767));
 
@@ -112,7 +112,7 @@ public final class TestHSSFPalette {
         assertEquals(64, cellB.getCellStyle().getFillForegroundColor());
         assertEquals(64, cellB.getCellStyle().getFillBackgroundColor());
         assertEquals(10, cellB.getCellStyle().getFont(book).getColor());
-        assertEquals(FillPatternType.NO_FILL, cellB.getCellStyle().getFillPatternEnum());
+        assertEquals(FillPatternType.NO_FILL, cellB.getCellStyle().getFillPattern());
         assertEquals("0:0:0", p.getColor((short)64).getHexString());
         assertEquals("FFFF:0:0", p.getColor((short)10).getHexString());
 
@@ -121,7 +121,7 @@ public final class TestHSSFPalette {
         assertEquals(11, cellC.getCellStyle().getFillForegroundColor());
         assertEquals(64, cellC.getCellStyle().getFillBackgroundColor());
         assertEquals(10, cellC.getCellStyle().getFont(book).getColor());
-        assertEquals(FillPatternType.SOLID_FOREGROUND, cellC.getCellStyle().getFillPatternEnum());
+        assertEquals(FillPatternType.SOLID_FOREGROUND, cellC.getCellStyle().getFillPattern());
         assertEquals("0:FFFF:0", p.getColor((short)11).getHexString());
         assertEquals("FFFF:0:0", p.getColor((short)10).getHexString());
 
@@ -130,7 +130,7 @@ public final class TestHSSFPalette {
         assertEquals(13, cellD.getCellStyle().getFillForegroundColor());
         assertEquals(64, cellD.getCellStyle().getFillBackgroundColor());
         assertEquals(14, cellD.getCellStyle().getFont(book).getColor());
-        assertEquals(FillPatternType.NO_FILL, cellD.getCellStyle().getFillPatternEnum());
+        assertEquals(FillPatternType.NO_FILL, cellD.getCellStyle().getFillPattern());
         assertEquals("FFFF:FFFF:0", p.getColor((short)13).getHexString());
         assertEquals("FFFF:0:FFFF", p.getColor((short)14).getHexString());
 
@@ -139,7 +139,7 @@ public final class TestHSSFPalette {
         assertEquals(13, cellE.getCellStyle().getFillForegroundColor());
         assertEquals(64, cellE.getCellStyle().getFillBackgroundColor());
         assertEquals(14, cellE.getCellStyle().getFont(book).getColor());
-        assertEquals(FillPatternType.NO_FILL, cellE.getCellStyle().getFillPatternEnum());
+        assertEquals(FillPatternType.NO_FILL, cellE.getCellStyle().getFillPattern());
         assertEquals("FFFF:FFFF:0", p.getColor((short)13).getHexString());
         assertEquals("FFFF:0:FFFF", p.getColor((short)14).getHexString());
     }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestRowStyle.java Sun Oct 22 12:45:35 2017
@@ -160,7 +160,7 @@ public final class TestRowStyle extends
             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:",         FillPatternType.BRICKS, cs.getFillPatternEnum());
+            assertEquals("FillPattern for row:",         FillPatternType.BRICKS, cs.getFillPattern());
             
             rownum++;
             if (rownum >= 100) break; // I feel too lazy to check if this isreqd :-/ 
@@ -169,7 +169,7 @@ public final class TestRowStyle extends
             assertNotNull("Row is not null", r);
             cs2 = r.getRowStyle();
             assertEquals("FillForegroundColor for row: ", cs2.getFillForegroundColor(), (short) 0x0);
-            assertEquals("FillPattern for row: ", cs2.getFillPatternEnum(), FillPatternType.BRICKS);
+            assertEquals("FillPattern for row: ", cs2.getFillPattern(), FillPatternType.BRICKS);
         }
         IOUtils.closeQuietly(wb2);
     }

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java Sun Oct 22 12:45:35 2017
@@ -715,7 +715,7 @@ public abstract class BaseTestCell {
         assertFalse(style.getHidden());
         assertEquals(0, style.getIndention());
         assertEquals(0, style.getFontIndex());
-        assertEquals(HorizontalAlignment.GENERAL, style.getAlignmentEnum());
+        assertEquals(HorizontalAlignment.GENERAL, style.getAlignment());
         assertEquals(0, style.getDataFormat());
         assertEquals(false, style.getWrapText());
 

Modified: poi/trunk/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java?rev=1812907&r1=1812906&r2=1812907&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java Sun Oct 22 12:45:35 2017
@@ -224,17 +224,17 @@ public class BaseTestCellUtil {
         // should be assertSame, but a new HSSFCellStyle is returned for each getCellStyle() call. 
         // HSSFCellStyle wraps an underlying style record, and the underlying
         // style record is the same between multiple getCellStyle() calls.
-        assertEquals(HorizontalAlignment.GENERAL, A1.getCellStyle().getAlignmentEnum());
-        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignmentEnum());
+        assertEquals(HorizontalAlignment.GENERAL, A1.getCellStyle().getAlignment());
+        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignment());
 
         // get/set alignment modifies the cell's style
         CellUtil.setAlignment(A1, HorizontalAlignment.RIGHT);
-        assertEquals(HorizontalAlignment.RIGHT, A1.getCellStyle().getAlignmentEnum());
+        assertEquals(HorizontalAlignment.RIGHT, A1.getCellStyle().getAlignment());
 
         // get/set alignment doesn't affect the style of cells with
         // the same style prior to modifying the style
         assertNotEquals(A1.getCellStyle(), B1.getCellStyle());
-        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignmentEnum());
+        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignment());
 
         wb.close();
     }
@@ -252,17 +252,17 @@ public class BaseTestCellUtil {
         // should be assertSame, but a new HSSFCellStyle is returned for each getCellStyle() call. 
         // HSSFCellStyle wraps an underlying style record, and the underlying
         // style record is the same between multiple getCellStyle() calls.
-        assertEquals(HorizontalAlignment.GENERAL, A1.getCellStyle().getAlignmentEnum());
-        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignmentEnum());
+        assertEquals(HorizontalAlignment.GENERAL, A1.getCellStyle().getAlignment());
+        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignment());
 
         // get/set alignment modifies the cell's style
         CellUtil.setAlignment(A1, HorizontalAlignment.RIGHT);
-        assertEquals(HorizontalAlignment.RIGHT, A1.getCellStyle().getAlignmentEnum());
+        assertEquals(HorizontalAlignment.RIGHT, A1.getCellStyle().getAlignment());
 
         // get/set alignment doesn't affect the style of cells with
         // the same style prior to modifying the style
         assertNotEquals(A1.getCellStyle(), B1.getCellStyle());
-        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignmentEnum());
+        assertEquals(HorizontalAlignment.GENERAL, B1.getCellStyle().getAlignment());
 
         wb.close();
     }
@@ -280,17 +280,17 @@ public class BaseTestCellUtil {
         // should be assertSame, but a new HSSFCellStyle is returned for each getCellStyle() call. 
         // HSSFCellStyle wraps an underlying style record, and the underlying
         // style record is the same between multiple getCellStyle() calls.
-        assertEquals(VerticalAlignment.BOTTOM, A1.getCellStyle().getVerticalAlignmentEnum());
-        assertEquals(VerticalAlignment.BOTTOM, B1.getCellStyle().getVerticalAlignmentEnum());
+        assertEquals(VerticalAlignment.BOTTOM, A1.getCellStyle().getVerticalAlignment());
+        assertEquals(VerticalAlignment.BOTTOM, B1.getCellStyle().getVerticalAlignment());
 
         // get/set alignment modifies the cell's style
         CellUtil.setVerticalAlignment(A1, VerticalAlignment.TOP);
-        assertEquals(VerticalAlignment.TOP, A1.getCellStyle().getVerticalAlignmentEnum());
+        assertEquals(VerticalAlignment.TOP, A1.getCellStyle().getVerticalAlignment());
 
         // get/set alignment doesn't affect the style of cells with
         // the same style prior to modifying the style
         assertNotEquals(A1.getCellStyle(), B1.getCellStyle());
-        assertEquals(VerticalAlignment.BOTTOM, B1.getCellStyle().getVerticalAlignmentEnum());
+        assertEquals(VerticalAlignment.BOTTOM, B1.getCellStyle().getVerticalAlignment());
 
         wb.close();
     }
@@ -375,7 +375,7 @@ public class BaseTestCellUtil {
         
         CellUtil.setCellStyleProperties(A1, properties);
         CellStyle style = A1.getCellStyle();
-        assertEquals("fill pattern", FillPatternType.BRICKS, style.getFillPatternEnum());
+        assertEquals("fill pattern", FillPatternType.BRICKS, style.getFillPattern());
         assertEquals("fill foreground color", IndexedColors.BLUE, IndexedColors.fromInt(style.getFillForegroundColor()));
         assertEquals("fill background color", IndexedColors.RED, IndexedColors.fromInt(style.getFillBackgroundColor()));
         wb1.close();
@@ -395,7 +395,7 @@ public class BaseTestCellUtil {
         
         CellUtil.setCellStyleProperties(A1, properties);
         CellStyle style = A1.getCellStyle();
-        assertEquals("fill pattern", FillPatternType.BRICKS, style.getFillPatternEnum());
+        assertEquals("fill pattern", FillPatternType.BRICKS, style.getFillPattern());
         assertEquals("fill foreground color", IndexedColors.BLUE, IndexedColors.fromInt(style.getFillForegroundColor()));
         assertEquals("fill background color", IndexedColors.RED, IndexedColors.fromInt(style.getFillBackgroundColor()));
 



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


Mime
View raw message