Author: fanningpj Date: Sun Oct 22 12:07:14 2017 New Revision: 1812901 URL: http://svn.apache.org/viewvc?rev=1812901&view=rev Log: Remove use of deprecated methods
Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFPicture.java poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.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/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFPicture.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFPicture.java?rev=1812901&r1=1812900&r2=1812901&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFPicture.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFPicture.java Sun Oct 22 12:07:14 2017 @@ -55,7 +55,7 @@ public final class SXSSFPicture implemen * numbers 0, 1, 2, ..., 9 as rendered in the normal style's font. There are 4 pixels of margin * padding (two on each side), plus 1 pixel padding for the gridlines. * - * This value is the same for default font in Office 2007 (Calibry) and Office 2003 and earlier (Arial) + * This value is the same for default font in Office 2007 (Calibri) and Office 2003 and earlier (Arial) */ private static float DEFAULT_COLUMN_WIDTH = 9.140625f; Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java?rev=1812901&r1=1812900&r2=1812901&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java Sun Oct 22 12:07:14 2017 @@ -47,11 +47,11 @@ import org.openxmlformats.schemas.spread public class XSSFFont implements Font { /** - * By default, Microsoft Office Excel 2007 uses the Calibry font in font size 11 + * By default, Microsoft Office Excel 2007 uses the Calibri font in font size 11 */ public static final String DEFAULT_FONT_NAME = "Calibri"; /** - * By default, Microsoft Office Excel 2007 uses the Calibry font in font size 11 + * By default, Microsoft Office Excel 2007 uses the Calibri font in font size 11 */ public static final short DEFAULT_FONT_SIZE = 11; /** Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java?rev=1812901&r1=1812900&r2=1812901&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java Sun Oct 22 12:07:14 2017 @@ -53,7 +53,7 @@ public final class XSSFPicture extends X * numbers 0, 1, 2, ..., 9 as rendered in the normal style's font. There are 4 pixels of margin * padding (two on each side), plus 1 pixel padding for the gridlines. * - * This value is the same for default font in Office 2007 (Calibry) and Office 2003 and earlier (Arial) + * This value is the same for default font in Office 2007 (Calibri) and Office 2003 and earlier (Arial) */ // private static float DEFAULT_COLUMN_WIDTH = 9.140625f; Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java?rev=1812901&r1=1812900&r2=1812901&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java Sun Oct 22 12:07:14 2017 @@ -123,7 +123,7 @@ public class XSSFWorkbook extends POIXML private static final Pattern COMMA_PATTERN = Pattern.compile(","); /** - * Width of one character of the default font in pixels. Same for Calibry and Arial. + * Width of one character of the default font in pixels. Same for Calibri and Arial. * @deprecated POI 3.17 beta 1 * @see Units#DEFAULT_CHARACTER_WIDTH */ Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java?rev=1812901&r1=1812900&r2=1812901&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java Sun Oct 22 12:07:14 2017 @@ -43,16 +43,7 @@ public class AbstractExcelUtils /*package*/ static final String EMPTY = ""; private static final short EXCEL_COLUMN_WIDTH_FACTOR = 256; private static final int UNIT_OFFSET_LENGTH = 7; - - /** - * @param alignment The horizontal alignment. See {@link HorizontalAlignment}. - * @return a friendly string representation of the alignment code - * @deprecated POI 3.15 beta 3. Use {@link #getAlign(HorizontalAlignment)} instead. - */ - public static String getAlign( short alignment ) - { - return getAlign(HorizontalAlignment.forInt(alignment)); - } + public static String getAlign( HorizontalAlignment alignment ) { switch ( alignment ) 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=1812901&r1=1812900&r2=1812901&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:07:14 2017 @@ -40,6 +40,7 @@ import org.apache.poi.hwpf.converter.Fon import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.util.Beta; import org.apache.poi.util.POILogFactory; @@ -335,17 +336,16 @@ public class ExcelToFoConverter extends { blockTarget.setAttribute( "white-space-collapse", "false" ); { - String textAlign = ExcelToFoUtils.getAlign( cellStyle - .getAlignment() ); + String textAlign = ExcelToFoUtils.getAlign( cellStyle.getAlignmentEnum() ); if ( ExcelToFoUtils.isNotEmpty( textAlign ) ) blockTarget.setAttribute( "text-align", textAlign ); } - if ( cellStyle.getFillPattern() == 0 ) + if ( cellStyle.getFillPatternEnum() == FillPatternType.NO_FILL ) { // no fill } - else if ( cellStyle.getFillPattern() == 1 ) + else if ( cellStyle.getFillPatternEnum() == 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=1812901&r1=1812900&r2=1812901&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:07:14 2017 @@ -190,12 +190,12 @@ public class ExcelToHtmlConverter extend StringBuilder style = new StringBuilder(); style.append( "white-space:pre-wrap;" ); - ExcelToHtmlUtils.appendAlign( style, cellStyle.getAlignment() ); + ExcelToHtmlUtils.appendAlign( style, cellStyle.getAlignmentEnum() ); - switch (cellStyle.getFillPattern()) { + switch (cellStyle.getFillPatternEnum()) { // no fill - case 0: break; - case 1: + case NO_FILL: break; + case SOLID_FOREGROUND: final HSSFColor foregroundColor = cellStyle.getFillForegroundColorColor(); if ( foregroundColor == null ) break; String fgCol = ExcelToHtmlUtils.getColor( foregroundColor ); @@ -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.getAlignment() ); + ExcelToHtmlUtils.appendAlign( innerDivStyle, cellStyle.getAlignmentEnum() ); htmlDocumentFacade.addStyleClass( outerDiv, cssClassPrefixDiv, innerDivStyle.toString() ); Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java?rev=1812901&r1=1812900&r2=1812901&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java Sun Oct 22 12:07:14 2017 @@ -19,13 +19,14 @@ package org.apache.poi.hssf.converter; import java.util.Arrays; import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.util.Beta; @Beta public class ExcelToHtmlUtils extends AbstractExcelUtils { - public static void appendAlign( StringBuilder style, short alignment ) + public static void appendAlign( StringBuilder style, HorizontalAlignment alignment ) { String cssAlign = getAlign( alignment ); if ( isEmpty( cssAlign ) ) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org