[Git][java-team/jasperreports][master] Use Apache POI 4.0 API
Andrej Shadura
gitlab at salsa.debian.org
Wed Feb 27 12:12:03 GMT 2019
Andrej Shadura pushed to branch master at Debian Java Maintainers / jasperreports
Commits:
7c942a41 by Andrej Shadura at 2019-02-27T12:11:32Z
Use Apache POI 4.0 API
- - - - -
3 changed files:
- debian/control
- + debian/patches/apache-poi-4.0.patch
- debian/patches/series
Changes:
=====================================
debian/control
=====================================
@@ -9,7 +9,7 @@ Build-Depends:
default-jdk,
groovy,
libantlr-java,
- libapache-poi-java,
+ libapache-poi-java (>= 4.0),
libbatik-java (>= 1.8),
libbsh-java,
libcastor-core-java,
=====================================
debian/patches/apache-poi-4.0.patch
=====================================
@@ -0,0 +1,1222 @@
+From: Andrej Shadura <andrewsh at debian.org>
+Date: Wed, 27 Feb 2019 13:10:12 +0100
+Subject: Use Apache POI 4.0 API
+
+--- a/jasperreports/src/net/sf/jasperreports/engine/export/JRXlsExporter.java
++++ b/jasperreports/src/net/sf/jasperreports/engine/export/JRXlsExporter.java
+@@ -52,6 +52,7 @@
+
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
++import org.apache.poi.common.usermodel.HyperlinkType;
+ import org.apache.poi.hpsf.SummaryInformation;
+ import org.apache.poi.hssf.usermodel.HSSFCell;
+ import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+@@ -69,9 +70,15 @@
+ import org.apache.poi.hssf.usermodel.HeaderFooter;
+ import org.apache.poi.hssf.util.HSSFColor;
+ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
++import org.apache.poi.ss.usermodel.BorderStyle;
++import org.apache.poi.ss.usermodel.CellType;
++import org.apache.poi.ss.usermodel.ClientAnchor;
+ import org.apache.poi.ss.usermodel.CreationHelper;
++import org.apache.poi.ss.usermodel.FillPatternType;
++import org.apache.poi.ss.usermodel.HorizontalAlignment;
+ import org.apache.poi.ss.usermodel.Hyperlink;
+ import org.apache.poi.ss.usermodel.Sheet;
++import org.apache.poi.ss.usermodel.VerticalAlignment;
+ import org.apache.poi.ss.util.CellRangeAddress;
+ import org.apache.poi.ss.util.CellReference;
+
+@@ -148,7 +155,7 @@
+
+ static
+ {
+- Hashtable<String, HSSFColor> hssfColors = HSSFColor.getTripletHash();
++ Map<String, HSSFColor> hssfColors = HSSFColor.getTripletHash();
+ hssfColorsRgbs = new LinkedHashMap<HSSFColor, short[]>();
+ for (HSSFColor color : hssfColors.values())
+ {
+@@ -177,11 +184,11 @@
+ /**
+ *
+ */
+- protected short whiteIndex = (new HSSFColor.WHITE()).getIndex();
+- protected short blackIndex = (new HSSFColor.BLACK()).getIndex();
++ protected short whiteIndex = HSSFColor.HSSFColorPredefined.WHITE.getIndex();
++ protected short blackIndex = HSSFColor.HSSFColorPredefined.BLACK.getIndex();
+ protected short customColorIndex = MIN_COLOR_INDEX;
+
+- protected short backgroundMode = HSSFCellStyle.SOLID_FOREGROUND;
++ protected FillPatternType backgroundMode = FillPatternType.SOLID_FOREGROUND;
+
+ protected HSSFDataFormat dataFormat;
+
+@@ -246,7 +253,7 @@
+
+ if (!configuration.isWhitePageBackground())
+ {
+- backgroundMode = HSSFCellStyle.NO_FILL;
++ backgroundMode = FillPatternType.NO_FILL;
+ }
+
+ nature =
+@@ -322,7 +329,7 @@
+ }
+ }
+ emptyCellStyle = workbook.createCellStyle();
+- emptyCellStyle.setFillForegroundColor((new HSSFColor.WHITE()).getIndex());
++ emptyCellStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
+ emptyCellStyle.setFillPattern(backgroundMode);
+ dataFormat = workbook.createDataFormat();
+ createHelper = workbook.getCreationHelper();
+@@ -475,8 +482,8 @@
+ sheet.setDisplayGridlines(showGridlines);
+
+ backgroundMode = Boolean.TRUE.equals(sheetInfo.whitePageBackground)
+- ? HSSFCellStyle.SOLID_FOREGROUND
+- : HSSFCellStyle.NO_FILL;
++ ? FillPatternType.SOLID_FOREGROUND
++ : FillPatternType.NO_FILL;
+
+ // maxRowFreezeIndex = 0;
+ // maxColumnFreezeIndex = 0;
+@@ -641,12 +648,12 @@
+ {
+ cell = row.createCell(colIndex);
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null)
+ {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
+ }
+
+@@ -660,8 +667,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ gridCell,
+@@ -710,11 +717,11 @@
+ }
+ BoxStyle boxStyle = new BoxStyle(side, line.getLinePen());
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null)
+ {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
+ }
+
+@@ -722,8 +729,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ boxStyle,
+@@ -745,11 +752,11 @@
+ {
+ short forecolor = getWorkbookColor(element.getLinePen().getLineColor()).getIndex();
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null)
+ {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
+ }
+
+@@ -757,8 +764,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ gridCell,
+@@ -788,15 +795,15 @@
+ short forecolor = getWorkbookColor(textElement.getForecolor()).getIndex();
+
+ TextAlignHolder textAlignHolder = getTextAlignHolder(textElement);
+- short horizontalAlignment = getHorizontalAlignment(textAlignHolder);
+- short verticalAlignment = getVerticalAlignment(textAlignHolder);
++ HorizontalAlignment horizontalAlignment = getHorizontalAlignment(textAlignHolder);
++ VerticalAlignment verticalAlignment = getVerticalAlignment(textAlignHolder);
+ short rotation = getRotation(textAlignHolder);
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null)
+ {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
+ }
+
+@@ -865,7 +872,7 @@
+ }
+
+ HSSFCellStyle cellStyle = initCreateCell(gridCell, colIndex, rowIndex, baseStyle);
+- cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
++ cell.setCellType(CellType.FORMULA);
+ cell.setCellFormula(formula);
+ endCreateCell(cellStyle);
+ return;
+@@ -892,7 +899,7 @@
+ HSSFCellStyle cellStyle = initCreateCell(gridCell, colIndex, rowIndex, baseStyle);
+ if (textValue.getText() == null || textValue.getText().length() == 0)
+ {
+- cell.setCellType(HSSFCell.CELL_TYPE_BLANK);
++ cell.setCellType(CellType.BLANK);
+ }
+ else
+ {
+@@ -922,7 +929,7 @@
+ HSSFCellStyle cellStyle = initCreateCell(gridCell, colIndex, rowIndex, baseStyle);
+ if (textValue.getValue() == null)
+ {
+- cell.setCellType(HSSFCell.CELL_TYPE_BLANK);
++ cell.setCellType(CellType.BLANK);
+ }
+ else
+ {
+@@ -950,7 +957,7 @@
+ Date date = textValue.getValue();
+ if (date == null)
+ {
+- cell.setCellType(HSSFCell.CELL_TYPE_BLANK);
++ cell.setCellType(CellType.BLANK);
+ }
+ else
+ {
+@@ -966,7 +973,7 @@
+ HSSFCellStyle cellStyle = initCreateCell(gridCell, colIndex, rowIndex, baseStyle);
+ if (textValue.getValue() == null)
+ {
+- cell.setCellType(HSSFCell.CELL_TYPE_BLANK);
++ cell.setCellType(CellType.BLANK);
+ }
+ else
+ {
+@@ -1085,35 +1092,35 @@
+ }
+ }
+
+- private short getHorizontalAlignment(TextAlignHolder alignment)
++ private HorizontalAlignment getHorizontalAlignment(TextAlignHolder alignment)
+ {
+ switch (alignment.horizontalAlignment)
+ {
+ case RIGHT:
+- return HSSFCellStyle.ALIGN_RIGHT;
++ return HorizontalAlignment.RIGHT;
+ case CENTER:
+- return HSSFCellStyle.ALIGN_CENTER;
++ return HorizontalAlignment.CENTER;
+ case JUSTIFIED:
+- return HSSFCellStyle.ALIGN_JUSTIFY;
++ return HorizontalAlignment.JUSTIFY;
+ case LEFT:
+ default:
+- return HSSFCellStyle.ALIGN_LEFT;
++ return HorizontalAlignment.LEFT;
+ }
+ }
+
+- private short getVerticalAlignment(TextAlignHolder alignment)
++ private VerticalAlignment getVerticalAlignment(TextAlignHolder alignment)
+ {
+ switch (alignment.verticalAlignment)
+ {
+ case BOTTOM:
+- return HSSFCellStyle.VERTICAL_BOTTOM;
++ return VerticalAlignment.BOTTOM;
+ case MIDDLE:
+- return HSSFCellStyle.VERTICAL_CENTER;
++ return VerticalAlignment.CENTER;
+ case JUSTIFIED:
+- return HSSFCellStyle.VERTICAL_JUSTIFY;
++ return VerticalAlignment.JUSTIFY;
+ case TOP:
+ default:
+- return HSSFCellStyle.VERTICAL_TOP;
++ return VerticalAlignment.TOP;
+ }
+ }
+
+@@ -1235,7 +1242,7 @@
+ (cf.getFontHeightInPoints() == fontSize) &&
+ ((cf.getUnderline() == HSSFFont.U_SINGLE)?(font.isUnderline()):(!font.isUnderline())) &&
+ (cf.getStrikeout() == font.isStrikeThrough()) &&
+- ((cf.getBoldweight() == HSSFFont.BOLDWEIGHT_BOLD)?(font.isBold()):(!font.isBold())) &&
++ ((cf.getBold())?(font.isBold()):(!font.isBold())) &&
+ (cf.getItalic() == font.isItalic()) &&
+ (cf.getTypeOffset() == superscriptType)
+ )
+@@ -1269,7 +1276,7 @@
+ }
+ if (font.isBold())
+ {
+- cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
++ cellFont.setBold(true);
+ }
+ if (font.isItalic())
+ {
+@@ -1329,10 +1336,10 @@
+ return cellStyle;
+ }
+ protected HSSFCellStyle getLoadedCellStyle(
+- short mode,
++ FillPatternType mode,
+ short backcolor,
+- short horizontalAlignment,
+- short verticalAlignment,
++ HorizontalAlignment horizontalAlignment,
++ VerticalAlignment verticalAlignment,
+ short rotation,
+ HSSFFont font,
+ JRExporterGridCell gridCell,
+@@ -1358,10 +1365,10 @@
+ }
+
+ protected HSSFCellStyle getLoadedCellStyle(
+- short mode,
++ FillPatternType mode,
+ short backcolor,
+- short horizontalAlignment,
+- short verticalAlignment,
++ HorizontalAlignment horizontalAlignment,
++ VerticalAlignment verticalAlignment,
+ short rotation,
+ HSSFFont font,
+ BoxStyle box,
+@@ -1378,7 +1385,7 @@
+ /**
+ *
+ */
+- protected static short getBorderStyle(JRPen pen)
++ protected static BorderStyle getBorderStyle(JRPen pen)
+ {
+ float lineWidth = pen.getLineWidth().floatValue();
+
+@@ -1388,43 +1395,43 @@
+ {
+ case DOUBLE :
+ {
+- return HSSFCellStyle.BORDER_DOUBLE;
++ return BorderStyle.DOUBLE;
+ }
+ case DOTTED :
+ {
+- return HSSFCellStyle.BORDER_DOTTED;
++ return BorderStyle.DOTTED;
+ }
+ case DASHED :
+ {
+ if (lineWidth >= 1f)
+ {
+- return HSSFCellStyle.BORDER_MEDIUM_DASHED;
++ return BorderStyle.MEDIUM_DASHED;
+ }
+
+- return HSSFCellStyle.BORDER_DASHED;
++ return BorderStyle.DASHED;
+ }
+ case SOLID :
+ default :
+ {
+ if (lineWidth >= 2f)
+ {
+- return HSSFCellStyle.BORDER_THICK;
++ return BorderStyle.THICK;
+ }
+ else if (lineWidth >= 1f)
+ {
+- return HSSFCellStyle.BORDER_MEDIUM;
++ return BorderStyle.MEDIUM;
+ }
+ else if (lineWidth >= 0.5f)
+ {
+- return HSSFCellStyle.BORDER_THIN;
++ return BorderStyle.THIN;
+ }
+
+- return HSSFCellStyle.BORDER_HAIR;
++ return BorderStyle.HAIR;
+ }
+ }
+ }
+
+- return HSSFCellStyle.BORDER_NONE;
++ return BorderStyle.NONE;
+ }
+
+ @Override
+@@ -1472,11 +1479,11 @@
+ {
+ XlsReportConfiguration configuration = getCurrentItemConfiguration();
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null)
+ {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
+ }
+
+@@ -1491,8 +1498,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ gridCell,
+@@ -1537,7 +1544,19 @@
+ imageAnchorType = ImageAnchorTypeEnum.MOVE_NO_SIZE;
+ }
+ }
+- anchor.setAnchorType(imageAnchorType.getValue());
++ switch (imageAnchorType)
++ {
++ case MOVE_SIZE:
++ anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
++ break;
++ case MOVE_NO_SIZE:
++ anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_DONT_RESIZE);
++ break;
++ case NO_MOVE_NO_SIZE:
++ default:
++ anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
++ break;
++ }
+ //pngEncoder.setImage(bi);
+ //int imgIndex = workbook.addPicture(pngEncoder.pngEncode(), HSSFWorkbook.PICTURE_TYPE_PNG);
+ int imgIndex = workbook.addPicture(imageProcessorResult.imageData, HSSFWorkbook.PICTURE_TYPE_PNG);
+@@ -1862,11 +1881,11 @@
+ @Override
+ protected void exportFrame(JRPrintFrame frame, JRExporterGridCell gridCell, int x, int y)
+ {
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (frame.getModeValue() == ModeEnum.OPAQUE)
+ {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(frame.getBackcolor()).getIndex();
+ }
+
+@@ -1876,8 +1895,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ gridCell,
+@@ -2016,7 +2035,7 @@
+ String href = hyperlink.getHyperlinkReference();
+ if (href != null)
+ {
+- link = createHelper.createHyperlink(Hyperlink.LINK_URL);
++ link = createHelper.createHyperlink(HyperlinkType.URL);
+ link.setAddress(href);
+ }
+ break;
+@@ -2029,7 +2048,7 @@
+ String href = hyperlink.getHyperlinkAnchor();
+ if (href != null)
+ {
+- link = createHelper.createHyperlink(Hyperlink.LINK_DOCUMENT);
++ link = createHelper.createHyperlink(HyperlinkType.DOCUMENT);
+ if(anchorLinks.containsKey(href))
+ {
+ (anchorLinks.get(href)).add(link);
+@@ -2050,7 +2069,7 @@
+ Integer hrefPage = (getCurrentItemConfiguration().isOnePagePerSheet() ? hyperlink.getHyperlinkPage() : 0);
+ if (hrefPage != null)
+ {
+- link = createHelper.createHyperlink(Hyperlink.LINK_DOCUMENT);
++ link = createHelper.createHyperlink(HyperlinkType.DOCUMENT);
+ if(pageLinks.containsKey(sheetsBeforeCurrentReport+hrefPage))
+ {
+ pageLinks.get(sheetsBeforeCurrentReport + hrefPage).add(link);
+@@ -2070,7 +2089,7 @@
+ if (href != null && hyperlink.getHyperlinkAnchor() != null)
+ {
+ href = href + "#" + hyperlink.getHyperlinkAnchor();
+- link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
++ link = createHelper.createHyperlink(HyperlinkType.FILE);
+ link.setAddress(href);
+
+ }
+@@ -2083,7 +2102,7 @@
+ if (href != null && hyperlink.getHyperlinkPage() != null)
+ {
+ href = href + "#JR_PAGE_ANCHOR_0_" + hyperlink.getHyperlinkPage().toString();
+- link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
++ link = createHelper.createHyperlink(HyperlinkType.FILE);
+ link.setAddress(href);
+
+ }
+@@ -2101,7 +2120,7 @@
+ String href = customHandler.getHyperlink(hyperlink);
+ if (href != null)
+ {
+- link = createHelper.createHyperlink(Hyperlink.LINK_URL);
++ link = createHelper.createHyperlink(HyperlinkType.URL);
+ link.setAddress(href);
+ }
+ }
+@@ -2210,7 +2229,7 @@
+ protected static final int BOTTOM = 2;
+ protected static final int RIGHT = 3;
+
+- protected short[] borderStyle = new short[4];
++ protected BorderStyle[] borderStyle = new BorderStyle[4];
+ protected short[] borderColour = new short[4];
+ private int hash;
+
+@@ -2261,13 +2280,13 @@
+ public void setPen(JRPen pen)
+ {
+ if (
+- borderStyle[TOP] == HSSFCellStyle.BORDER_NONE
+- && borderStyle[LEFT] == HSSFCellStyle.BORDER_NONE
+- && borderStyle[BOTTOM] == HSSFCellStyle.BORDER_NONE
+- && borderStyle[RIGHT] == HSSFCellStyle.BORDER_NONE
++ borderStyle[TOP] == BorderStyle.NONE
++ && borderStyle[LEFT] == BorderStyle.NONE
++ && borderStyle[BOTTOM] == BorderStyle.NONE
++ && borderStyle[RIGHT] == BorderStyle.NONE
+ )
+ {
+- short style = JRXlsExporter.getBorderStyle(pen);
++ BorderStyle style = JRXlsExporter.getBorderStyle(pen);
+ short colour = JRXlsExporter.this.getWorkbookColor(pen.getLineColor()).getIndex();
+
+ borderStyle[TOP] = style;
+@@ -2286,13 +2305,13 @@
+
+ private int computeHash()
+ {
+- int hashCode = borderStyle[TOP];
++ int hashCode = borderStyle[TOP].getCode();
+ hashCode = 31*hashCode + borderColour[TOP];
+- hashCode = 31*hashCode + borderStyle[BOTTOM];
++ hashCode = 31*hashCode + borderStyle[BOTTOM].getCode();
+ hashCode = 31*hashCode + borderColour[BOTTOM];
+- hashCode = 31*hashCode + borderStyle[LEFT];
++ hashCode = 31*hashCode + borderStyle[LEFT].getCode();
+ hashCode = 31*hashCode + borderColour[LEFT];
+- hashCode = 31*hashCode + borderStyle[RIGHT];
++ hashCode = 31*hashCode + borderStyle[RIGHT].getCode();
+ hashCode = 31*hashCode + borderColour[RIGHT];
+ return hashCode;
+ }
+@@ -2336,10 +2355,10 @@
+ */
+ protected class StyleInfo
+ {
+- protected final short mode;
++ protected final FillPatternType mode;
+ protected final short backcolor;
+- protected final short horizontalAlignment;
+- protected final short verticalAlignment;
++ protected final HorizontalAlignment horizontalAlignment;
++ protected final VerticalAlignment verticalAlignment;
+ protected final short rotation;
+ protected final HSSFFont font;
+ protected final BoxStyle box;
+@@ -2351,10 +2370,10 @@
+ private int hashCode;
+
+ public StyleInfo(
+- short mode,
++ FillPatternType mode,
+ short backcolor,
+- short horizontalAlignment,
+- short verticalAlignment,
++ HorizontalAlignment horizontalAlignment,
++ VerticalAlignment verticalAlignment,
+ short rotation,
+ HSSFFont font,
+ JRExporterGridCell gridCell,
+@@ -2378,10 +2397,10 @@
+ }
+
+ public StyleInfo(
+- short mode,
++ FillPatternType mode,
+ short backcolor,
+- short horizontalAlignment,
+- short verticalAlignment,
++ HorizontalAlignment horizontalAlignment,
++ VerticalAlignment verticalAlignment,
+ short rotation,
+ HSSFFont font,
+ BoxStyle box,
+@@ -2408,10 +2427,10 @@
+
+ protected int computeHash()
+ {
+- int hash = mode;
++ int hash = mode.getCode();
+ hash = 31*hash + backcolor;
+- hash = 31*hash + horizontalAlignment;
+- hash = 31*hash + verticalAlignment;
++ hash = 31*hash + horizontalAlignment.getCode();
++ hash = 31*hash + verticalAlignment.getCode();
+ hash = 31*hash + rotation;
+ hash = 31*hash + (font == null ? 0 : font.getIndex());
+ hash = 31*hash + (box == null ? 0 : box.hashCode());
+--- a/jasperreports/src/net/sf/jasperreports/engine/export/JRXlsMetadataExporter.java
++++ b/jasperreports/src/net/sf/jasperreports/engine/export/JRXlsMetadataExporter.java
+@@ -57,6 +57,7 @@
+ import org.apache.commons.collections.map.ReferenceMap;
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
++import org.apache.poi.common.usermodel.HyperlinkType;
+ import org.apache.poi.hssf.usermodel.HSSFCell;
+ import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+ import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
+@@ -73,10 +74,15 @@
+ import org.apache.poi.hssf.usermodel.HeaderFooter;
+ import org.apache.poi.hssf.util.HSSFColor;
+ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
++import org.apache.poi.ss.usermodel.BorderStyle;
++import org.apache.poi.ss.usermodel.CellType;
+ import org.apache.poi.ss.usermodel.CreationHelper;
++import org.apache.poi.ss.usermodel.FillPatternType;
++import org.apache.poi.ss.usermodel.HorizontalAlignment;
+ import org.apache.poi.ss.usermodel.Hyperlink;
+ import org.apache.poi.ss.usermodel.RichTextString;
+ import org.apache.poi.ss.usermodel.Sheet;
++import org.apache.poi.ss.usermodel.VerticalAlignment;
+ import org.apache.poi.ss.util.CellReference;
+
+ import net.sf.jasperreports.engine.DefaultJasperReportsContext;
+@@ -171,11 +177,11 @@
+ /**
+ *
+ */
+- protected short whiteIndex = (new HSSFColor.WHITE()).getIndex();
+- protected short blackIndex = (new HSSFColor.BLACK()).getIndex();
++ protected short whiteIndex = HSSFColor.HSSFColorPredefined.WHITE.getIndex();
++ protected short blackIndex = HSSFColor.HSSFColorPredefined.BLACK.getIndex();
+ protected short customColorIndex = MIN_COLOR_INDEX;
+
+- protected short backgroundMode = HSSFCellStyle.SOLID_FOREGROUND;
++ protected FillPatternType backgroundMode = FillPatternType.SOLID_FOREGROUND;
+
+ protected HSSFDataFormat dataFormat;
+
+@@ -238,7 +244,7 @@
+
+ if (!configuration.isWhitePageBackground())
+ {
+- backgroundMode = HSSFCellStyle.NO_FILL;
++ backgroundMode = FillPatternType.NO_FILL;
+ }
+
+ nature =
+@@ -291,7 +297,7 @@
+ }
+ }
+ emptyCellStyle = workbook.createCellStyle();
+- emptyCellStyle.setFillForegroundColor((new HSSFColor.WHITE()).getIndex());
++ emptyCellStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
+ emptyCellStyle.setFillPattern(backgroundMode);
+ dataFormat = workbook.createDataFormat();
+ createHelper = workbook.getCreationHelper();
+@@ -398,8 +404,8 @@
+ sheet.setDisplayGridlines(showGridlines);
+
+ backgroundMode = Boolean.TRUE.equals(sheetInfo.whitePageBackground)
+- ? HSSFCellStyle.SOLID_FOREGROUND
+- : HSSFCellStyle.NO_FILL;
++ ? FillPatternType.SOLID_FOREGROUND
++ : FillPatternType.NO_FILL;
+
+
+ // maxRowFreezeIndex = 0;
+@@ -638,10 +644,10 @@
+ }
+ BoxStyle boxStyle = new BoxStyle(side, line.getLinePen());
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && line.getBackcolor() != null) {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(line.getBackcolor()).getIndex();
+ }
+
+@@ -649,8 +655,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ boxStyle,
+@@ -675,10 +681,10 @@
+
+ short forecolor = getWorkbookColor(element.getLinePen().getLineColor()).getIndex();
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && element.getBackcolor() != null) {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(element.getBackcolor()).getIndex();
+ }
+
+@@ -686,8 +692,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ new BoxStyle(element),
+@@ -715,16 +721,16 @@
+ final short forecolor = getWorkbookColor(textElement.getForecolor()).getIndex();
+
+ TextAlignHolder textAlignHolder = getTextAlignHolder(textElement);
+- short horizontalAlignment = getHorizontalAlignment(textAlignHolder);
+- short verticalAlignment = getVerticalAlignment(textAlignHolder);
++ HorizontalAlignment horizontalAlignment = getHorizontalAlignment(textAlignHolder);
++ VerticalAlignment verticalAlignment = getVerticalAlignment(textAlignHolder);
+ short rotation = getRotation(textAlignHolder);
+
+ XlsReportConfiguration configuration = getCurrentItemConfiguration();
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && textElement.getBackcolor() != null) {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(textElement.getBackcolor()).getIndex();
+ }
+
+@@ -793,7 +799,7 @@
+ }
+ }
+
+- cellSettings.importValues(HSSFCell.CELL_TYPE_FORMULA, getLoadedCellStyle(baseStyle), null, formula);
++ cellSettings.importValues(CellType.FORMULA, getLoadedCellStyle(baseStyle), null, formula);
+
+ } else if (getCurrentItemConfiguration().isDetectCellType()) {
+ TextValue value = getTextValue(textElement, textStr);
+@@ -801,9 +807,9 @@
+ @Override
+ public void handle(StringTextValue textValue) {
+ if (JRCommonText.MARKUP_NONE.equals(textElement.getMarkup())) {
+- cellSettings.importValues(HSSFCell.CELL_TYPE_STRING, getLoadedCellStyle(baseStyle), new HSSFRichTextString(textValue.getText()));
++ cellSettings.importValues(CellType.STRING, getLoadedCellStyle(baseStyle), new HSSFRichTextString(textValue.getText()));
+ } else {
+- cellSettings.importValues(HSSFCell.CELL_TYPE_STRING, getLoadedCellStyle(baseStyle), getRichTextString(styledText, forecolor, textElement, getTextLocale(textElement)));
++ cellSettings.importValues(CellType.STRING, getLoadedCellStyle(baseStyle), getRichTextString(styledText, forecolor, textElement, getTextLocale(textElement)));
+ }
+ }
+
+@@ -834,7 +840,7 @@
+ value = value.doubleValue() / 86400;
+ }
+
+- cellSettings.importValues(HSSFCell.CELL_TYPE_NUMERIC, getLoadedCellStyle(baseStyle), value);
++ cellSettings.importValues(CellType.NUMERIC, getLoadedCellStyle(baseStyle), value);
+ }
+
+ @Override
+@@ -859,20 +865,20 @@
+ } else {
+ value = textValue.getValue() == null ? null : translateDateValue(textElement, textValue.getValue());
+ }
+- cellSettings.importValues(HSSFCell.CELL_TYPE_NUMERIC, getLoadedCellStyle(baseStyle), value);
++ cellSettings.importValues(CellType.NUMERIC, getLoadedCellStyle(baseStyle), value);
+ }
+
+ @Override
+ public void handle(BooleanTextValue textValue) {
+ Boolean value = hasCurrentColumnData ? Boolean.valueOf(textStr) : textValue.getValue();
+- cellSettings.importValues(HSSFCell.CELL_TYPE_BOOLEAN, getLoadedCellStyle(baseStyle), value);
++ cellSettings.importValues(CellType.BOOLEAN, getLoadedCellStyle(baseStyle), value);
+ }
+ });
+ } else {
+ if (JRCommonText.MARKUP_NONE.equals(textElement.getMarkup())) {
+- cellSettings.importValues(HSSFCell.CELL_TYPE_STRING, getLoadedCellStyle(baseStyle), new HSSFRichTextString(textStr));
++ cellSettings.importValues(CellType.STRING, getLoadedCellStyle(baseStyle), new HSSFRichTextString(textStr));
+ } else {
+- cellSettings.importValues(HSSFCell.CELL_TYPE_STRING, getLoadedCellStyle(baseStyle), getRichTextString(styledText, forecolor, textElement, getTextLocale(textElement)));
++ cellSettings.importValues(CellType.STRING, getLoadedCellStyle(baseStyle), getRichTextString(styledText, forecolor, textElement, getTextLocale(textElement)));
+ }
+ }
+
+@@ -909,7 +915,7 @@
+ case REFERENCE: {
+ String href = hyperlink.getHyperlinkReference();
+ if (href != null) {
+- link = createHelper.createHyperlink(Hyperlink.LINK_URL);
++ link = createHelper.createHyperlink(HyperlinkType.URL);
+ link.setAddress(href);
+ }
+ break;
+@@ -918,7 +924,7 @@
+ if(!getCurrentItemConfiguration().isIgnoreAnchors()) {
+ String href = hyperlink.getHyperlinkAnchor();
+ if (href != null) {
+- link = createHelper.createHyperlink(Hyperlink.LINK_DOCUMENT);
++ link = createHelper.createHyperlink(HyperlinkType.DOCUMENT);
+ if(anchorLinks.containsKey(href)) {
+ (anchorLinks.get(href)).add(link);
+ } else {
+@@ -934,7 +940,7 @@
+ {
+ Integer hrefPage = (getCurrentItemConfiguration().isOnePagePerSheet() ? hyperlink.getHyperlinkPage() : 0);
+ if (hrefPage != null) {
+- link = createHelper.createHyperlink(Hyperlink.LINK_DOCUMENT);
++ link = createHelper.createHyperlink(HyperlinkType.DOCUMENT);
+ if(pageLinks.containsKey(sheetsBeforeCurrentReport+hrefPage)) {
+ pageLinks.get(sheetsBeforeCurrentReport + hrefPage).add(link);
+ } else {
+@@ -949,7 +955,7 @@
+ String href = hyperlink.getHyperlinkReference();
+ if (href != null && hyperlink.getHyperlinkAnchor() != null) {
+ href = href + "#" + hyperlink.getHyperlinkAnchor();
+- link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
++ link = createHelper.createHyperlink(HyperlinkType.FILE);
+ link.setAddress(href);
+
+ }
+@@ -959,7 +965,7 @@
+ String href = hyperlink.getHyperlinkReference();
+ if (href != null && hyperlink.getHyperlinkPage() != null) {
+ href = href + "#JR_PAGE_ANCHOR_0_" + hyperlink.getHyperlinkPage().toString();
+- link = createHelper.createHyperlink(Hyperlink.LINK_FILE);
++ link = createHelper.createHyperlink(HyperlinkType.FILE);
+ link.setAddress(href);
+
+ }
+@@ -972,7 +978,7 @@
+ } else {
+ String href = customHandler.getHyperlink(hyperlink);
+ if (href != null) {
+- link = createHelper.createHyperlink(Hyperlink.LINK_URL);
++ link = createHelper.createHyperlink(HyperlinkType.URL);
+ link.setAddress(href);
+ }
+ }
+@@ -1106,10 +1112,10 @@
+ {
+ XlsMetadataReportConfiguration configuration = getCurrentItemConfiguration();
+
+- short mode = backgroundMode;
++ FillPatternType mode = backgroundMode;
+ short backcolor = whiteIndex;
+ if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && element.getBackcolor() != null) {
+- mode = HSSFCellStyle.SOLID_FOREGROUND;
++ mode = FillPatternType.SOLID_FOREGROUND;
+ backcolor = getWorkbookColor(element.getBackcolor()).getIndex();
+ }
+
+@@ -1123,8 +1129,8 @@
+ getLoadedCellStyle(
+ mode,
+ backcolor,
+- HSSFCellStyle.ALIGN_LEFT,
+- HSSFCellStyle.VERTICAL_TOP,
++ HorizontalAlignment.LEFT,
++ VerticalAlignment.TOP,
+ (short)0,
+ getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
+ new BoxStyle(element),
+@@ -1482,10 +1488,10 @@
+ }
+
+ protected HSSFCellStyle getLoadedCellStyle(
+- short mode,
++ FillPatternType mode,
+ short backcolor,
+- short horizontalAlignment,
+- short verticalAlignment,
++ HorizontalAlignment horizontalAlignment,
++ VerticalAlignment verticalAlignment,
+ short rotation,
+ HSSFFont font,
+ BoxStyle box,
+@@ -1500,38 +1506,38 @@
+ /**
+ *
+ */
+- protected static short getBorderStyle(JRPen pen) {
++ protected static BorderStyle getBorderStyle(JRPen pen) {
+ float lineWidth = pen.getLineWidth().floatValue();
+
+ if (lineWidth > 0f) {
+ switch (pen.getLineStyleValue()) {
+ case DOUBLE : {
+- return HSSFCellStyle.BORDER_DOUBLE;
++ return BorderStyle.DOUBLE;
+ }
+ case DOTTED : {
+- return HSSFCellStyle.BORDER_DOTTED;
++ return BorderStyle.DOTTED;
+ }
+ case DASHED : {
+ if (lineWidth >= 1f) {
+- return HSSFCellStyle.BORDER_MEDIUM_DASHED;
++ return BorderStyle.MEDIUM_DASHED;
+ }
+- return HSSFCellStyle.BORDER_DASHED;
++ return BorderStyle.DASHED;
+ }
+ case SOLID :
+ default : {
+ if (lineWidth >= 2f) {
+- return HSSFCellStyle.BORDER_THICK;
++ return BorderStyle.THICK;
+ }
+ else if (lineWidth >= 1f) {
+- return HSSFCellStyle.BORDER_MEDIUM;
++ return BorderStyle.MEDIUM;
+ } else if (lineWidth >= 0.5f) {
+- return HSSFCellStyle.BORDER_THIN;
++ return BorderStyle.THIN;
+ }
+- return HSSFCellStyle.BORDER_HAIR;
++ return BorderStyle.HAIR;
+ }
+ }
+ }
+- return HSSFCellStyle.BORDER_NONE;
++ return BorderStyle.NONE;
+ }
+
+ @Override
+@@ -1634,7 +1640,7 @@
+ for(int i = 0; i< columnNames.size(); i++) {
+ String columnName = columnNames.get(i);
+ cell = row.createCell(i);
+- cell.setCellType(HSSFCell.CELL_TYPE_STRING);
++ cell.setCellType(CellType.STRING);
+ cell.setCellValue(new HSSFRichTextString(columnName));
+ }
+ }
+@@ -1751,33 +1757,36 @@
+ }
+ return ps;
+ }
+-
+- private short getHorizontalAlignment(TextAlignHolder alignment) {
+- switch (alignment.horizontalAlignment)
++
++ private HorizontalAlignment getHorizontalAlignment(TextAlignHolder alignment)
++ {
++ switch (alignment.horizontalAlignment)
+ {
+ case RIGHT:
+- return HSSFCellStyle.ALIGN_RIGHT;
++ return HorizontalAlignment.RIGHT;
+ case CENTER:
+- return HSSFCellStyle.ALIGN_CENTER;
++ return HorizontalAlignment.CENTER;
+ case JUSTIFIED:
+- return HSSFCellStyle.ALIGN_JUSTIFY;
++ return HorizontalAlignment.JUSTIFY;
+ case LEFT:
+ default:
+- return HSSFCellStyle.ALIGN_LEFT;
++ return HorizontalAlignment.LEFT;
+ }
+ }
+
+- private short getVerticalAlignment(TextAlignHolder alignment) {
+- switch (alignment.verticalAlignment) {
++ private VerticalAlignment getVerticalAlignment(TextAlignHolder alignment)
++ {
++ switch (alignment.verticalAlignment)
++ {
+ case BOTTOM:
+- return HSSFCellStyle.VERTICAL_BOTTOM;
++ return VerticalAlignment.BOTTOM;
+ case MIDDLE:
+- return HSSFCellStyle.VERTICAL_CENTER;
++ return VerticalAlignment.CENTER;
+ case JUSTIFIED:
+- return HSSFCellStyle.VERTICAL_JUSTIFY;
++ return VerticalAlignment.JUSTIFY;
+ case TOP:
+ default:
+- return HSSFCellStyle.VERTICAL_TOP;
++ return VerticalAlignment.TOP;
+ }
+ }
+
+@@ -1889,7 +1898,7 @@
+ (cf.getFontHeightInPoints() == fontSize) &&
+ ((cf.getUnderline() == HSSFFont.U_SINGLE)?(font.isUnderline()):(!font.isUnderline())) &&
+ (cf.getStrikeout() == font.isStrikeThrough()) &&
+- ((cf.getBoldweight() == HSSFFont.BOLDWEIGHT_BOLD)?(font.isBold()):(!font.isBold())) &&
++ ((cf.getBold())?(font.isBold()):(!font.isBold())) &&
+ (cf.getItalic() == font.isItalic()) &&
+ (cf.getTypeOffset() == superscriptType)
+ ) {
+@@ -1916,7 +1925,7 @@
+ cellFont.setStrikeout(true);
+ }
+ if (font.isBold()) {
+- cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
++ cellFont.setBold(true);
+ }
+ if (font.isItalic()) {
+ cellFont.setItalic(true);
+@@ -1955,7 +1964,7 @@
+ protected static final int BOTTOM = 2;
+ protected static final int RIGHT = 3;
+
+- protected short[] borderStyle = new short[4];
++ protected BorderStyle[] borderStyle = new BorderStyle[4];
+ protected short[] borderColour = new short[4];
+ private int hash;
+
+@@ -1995,12 +2004,12 @@
+
+ public void setPen(JRPen pen) {
+ if (
+- borderStyle[TOP] == HSSFCellStyle.BORDER_NONE
+- && borderStyle[LEFT] == HSSFCellStyle.BORDER_NONE
+- && borderStyle[BOTTOM] == HSSFCellStyle.BORDER_NONE
+- && borderStyle[RIGHT] == HSSFCellStyle.BORDER_NONE
++ borderStyle[TOP] == BorderStyle.NONE
++ && borderStyle[LEFT] == BorderStyle.NONE
++ && borderStyle[BOTTOM] == BorderStyle.NONE
++ && borderStyle[RIGHT] == BorderStyle.NONE
+ ) {
+- short style = JRXlsMetadataExporter.getBorderStyle(pen);
++ BorderStyle style = JRXlsMetadataExporter.getBorderStyle(pen);
+ short colour = JRXlsMetadataExporter.this.getWorkbookColor(pen.getLineColor()).getIndex();
+
+ borderStyle[TOP] = style;
+@@ -2064,10 +2073,10 @@
+ *
+ */
+ protected class StyleInfo {
+- protected final short mode;
++ protected final FillPatternType mode;
+ protected final short backcolor;
+- protected final short horizontalAlignment;
+- protected final short verticalAlignment;
++ protected final HorizontalAlignment horizontalAlignment;
++ protected final VerticalAlignment verticalAlignment;
+ protected final short rotation;
+ protected final HSSFFont font;
+ protected final BoxStyle box;
+@@ -2079,10 +2088,10 @@
+ private int hashCode;
+
+ public StyleInfo(
+- short mode,
++ FillPatternType mode,
+ short backcolor,
+- short horizontalAlignment,
+- short verticalAlignment,
++ HorizontalAlignment horizontalAlignment,
++ VerticalAlignment verticalAlignment,
+ short rotation,
+ HSSFFont font,
+ BoxStyle box,
+@@ -2168,7 +2177,7 @@
+
+
+ protected class CellSettings {
+- private int cellType;
++ private CellType cellType;
+ private HSSFCellStyle cellStyle;
+ private Object cellValue;
+ private String formula;
+@@ -2177,16 +2186,16 @@
+ public CellSettings() {
+ }
+ public CellSettings(HSSFCellStyle cellStyle) {
+- this(HSSFCell.CELL_TYPE_BLANK, cellStyle, null);
++ this(CellType.BLANK, cellStyle, null);
+ }
+ public CellSettings(
+- int cellType,
++ CellType cellType,
+ HSSFCellStyle cellStyle,
+ Object cellValue) {
+ this(cellType, cellStyle, cellValue, null);
+ }
+ public CellSettings(
+- int cellType,
++ CellType cellType,
+ HSSFCellStyle cellStyle,
+ Object cellValue,
+ String formula) {
+@@ -2194,7 +2203,7 @@
+ }
+
+ public CellSettings(
+- int cellType,
++ CellType cellType,
+ HSSFCellStyle cellStyle,
+ Object cellValue,
+ String formula,
+@@ -2215,7 +2224,7 @@
+ public int getCellType() {
+ return cellType;
+ }
+- public void setCellType(int cellType) {
++ public void setCellType(CellType cellType) {
+ this.cellType = cellType;
+ }
+ public Object getCellValue() {
+@@ -2238,20 +2247,20 @@
+ }
+
+ public void importValues(
+- int cellType,
++ CellType cellType,
+ HSSFCellStyle cellStyle,
+ Object cellValue) {
+ this.importValues(cellType, cellStyle, cellValue, null);
+ }
+ public void importValues(
+- int cellType,
++ CellType cellType,
+ HSSFCellStyle cellStyle,
+ Object cellValue,
+ String formula) {
+ this.importValues(cellType, cellStyle, cellValue, formula, null);
+ }
+ public void importValues(
+- int cellType,
++ CellType cellType,
+ HSSFCellStyle cellStyle,
+ Object cellValue,
+ String formula,
+--- a/jasperreports/src/net/sf/jasperreports/engine/data/AbstractPoiXlsDataSource.java
++++ b/jasperreports/src/net/sf/jasperreports/engine/data/AbstractPoiXlsDataSource.java
+@@ -33,6 +33,7 @@
+ import java.util.Map;
+
+ import org.apache.poi.ss.usermodel.Cell;
++import org.apache.poi.ss.usermodel.CellType;
+ import org.apache.poi.ss.usermodel.FormulaEvaluator;
+ import org.apache.poi.ss.usermodel.Row;
+ import org.apache.poi.ss.usermodel.Sheet;
+@@ -237,16 +238,16 @@
+ {
+ return null;
+ }
+- if(cell.getCellType() == Cell.CELL_TYPE_FORMULA)
++ if(cell.getCellType() == CellType.FORMULA)
+ {
+ FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
+ Object value = null;
+ switch (evaluator.evaluateFormulaCell(cell))
+ {
+- case Cell.CELL_TYPE_BOOLEAN:
++ case BOOLEAN:
+ value = cell.getBooleanCellValue();
+ break;
+- case Cell.CELL_TYPE_NUMERIC:
++ case NUMERIC:
+ if(Date.class.isAssignableFrom(valueClass))
+ {
+ value = cell.getDateCellValue();
+@@ -256,7 +257,7 @@
+ value = cell.getNumericCellValue();
+ }
+ break;
+- case Cell.CELL_TYPE_STRING:
++ case STRING:
+ value = cell.getStringCellValue();
+ if(Date.class.isAssignableFrom(valueClass))
+ {
+@@ -295,9 +296,9 @@
+ }
+ }
+ break;
+- case Cell.CELL_TYPE_BLANK:
+- case Cell.CELL_TYPE_ERROR:
+- case Cell.CELL_TYPE_FORMULA:
++ case BLANK:
++ case ERROR:
++ case FORMULA:
+ default:
+ break;
+ }
+@@ -310,7 +311,7 @@
+ }
+ if (valueClass.equals(Boolean.class))
+ {
+- if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN)
++ if (cell.getCellType() == CellType.BOOLEAN)
+ {
+ return cell.getBooleanCellValue();
+ }
+@@ -329,7 +330,7 @@
+ }
+ else if (Number.class.isAssignableFrom(valueClass))
+ {
+- if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC)
++ if (cell.getCellType() == CellType.NUMERIC)
+ {
+ return convertNumber(cell.getNumericCellValue(), valueClass);
+ }
+@@ -355,7 +356,7 @@
+ }
+ else if (Date.class.isAssignableFrom(valueClass))
+ {
+- if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC)
++ if (cell.getCellType() == CellType.NUMERIC)
+ {
+ return cell.getDateCellValue();
+ }
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ build.patch
commons-codec-Base64.patch
exclude-barcode4j-and-barbecue.patch
no-commons-javaflow.patch
+apache-poi-4.0.patch
View it on GitLab: https://salsa.debian.org/java-team/jasperreports/commit/7c942a41250c8bb294a55771b0560c6471faf045
--
View it on GitLab: https://salsa.debian.org/java-team/jasperreports/commit/7c942a41250c8bb294a55771b0560c6471faf045
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190227/92b30771/attachment.html>
More information about the pkg-java-commits
mailing list