aboutsummaryrefslogtreecommitdiffstats
path: root/src/scratchpad
diff options
context:
space:
mode:
Diffstat (limited to 'src/scratchpad')
-rw-r--r--src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java11
-rw-r--r--src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java8
-rw-r--r--src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java10
-rw-r--r--src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java3
4 files changed, 12 insertions, 20 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java b/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java
index 614b749358..ece9b46831 100644
--- a/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java
+++ b/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelUtils.java
@@ -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 )
diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
index b19aca9cd8..7666cccbb1 100644
--- a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
+++ b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
@@ -40,6 +40,7 @@ import org.apache.poi.hwpf.converter.FontReplacer.Triplet;
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 AbstractExcelConverter
{
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();
diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
index 87c92734a8..1befb72e46 100644
--- a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
+++ b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
@@ -190,12 +190,12 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
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 extends AbstractExcelConverter
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() );
diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java
index f19023f047..fbc20e1e09 100644
--- a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java
+++ b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java
@@ -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 ) )