From 9ce13ae7b7277f8d72d634b95118ccf01c105f23 Mon Sep 17 00:00:00 2001 From: "ARTECH\\sgrampone" Date: Thu, 31 Mar 2022 12:16:04 -0300 Subject: [PATCH] Bump poi libraries from version 4.1.2 to version 5.2.2 Issue#95281 CVE-2022-26336 #GXSEC --- gxoffice/pom.xml | 6 +++--- .../com/genexus/gxoffice/poi/hssf/ExcelCells.java | 12 ++++++------ .../genexus/msoffice/excel/poi/xssf/ExcelCells.java | 8 ++++---- .../msoffice/excel/poi/xssf/ExcelSpreadsheet.java | 4 ++-- gxsearch/pom.xml | 6 +++--- pom.xml | 1 + 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/gxoffice/pom.xml b/gxoffice/pom.xml index eb19a616a..515c53b7b 100644 --- a/gxoffice/pom.xml +++ b/gxoffice/pom.xml @@ -27,12 +27,12 @@ org.apache.poi poi-scratchpad - 4.1.2 + ${poi.version} org.apache.poi poi-ooxml - 4.1.2 + ${poi.version} org.apache.commons @@ -42,7 +42,7 @@ org.apache.poi poi - 4.1.2 + ${poi.version} commons-codec diff --git a/gxoffice/src/main/java/com/genexus/gxoffice/poi/hssf/ExcelCells.java b/gxoffice/src/main/java/com/genexus/gxoffice/poi/hssf/ExcelCells.java index 5505fdbbc..4d3e0c40a 100644 --- a/gxoffice/src/main/java/com/genexus/gxoffice/poi/hssf/ExcelCells.java +++ b/gxoffice/src/main/java/com/genexus/gxoffice/poi/hssf/ExcelCells.java @@ -752,15 +752,15 @@ public void setColor(long value) // 05/07/05 B@tero } private void copyPropertiesStyle(HSSFCellStyle dest, HSSFCellStyle source) { - dest.setAlignment(source.getAlignmentEnum()); - dest.setBorderBottom(source.getBorderBottomEnum()); - dest.setBorderLeft(source.getBorderLeftEnum()); - dest.setBorderTop(source.getBorderTopEnum()); + dest.setAlignment(source.getAlignment()); + dest.setBorderBottom(source.getBorderBottom()); + dest.setBorderLeft(source.getBorderLeft()); + dest.setBorderTop(source.getBorderTop()); dest.setBottomBorderColor(source.getBottomBorderColor()); dest.setDataFormat(source.getDataFormat()); dest.setFillBackgroundColor(source.getFillBackgroundColor()); dest.setFillForegroundColor(source.getFillForegroundColor()); - dest.setFillPattern(source.getFillPatternEnum()); + dest.setFillPattern(source.getFillPattern()); dest.setFont(pWorkbook.getFontAt(source.getFontIndexAsInt())); dest.setHidden(source.getHidden()); dest.setIndention(source.getIndention()); @@ -769,7 +769,7 @@ private void copyPropertiesStyle(HSSFCellStyle dest, HSSFCellStyle source) { dest.setRightBorderColor(source.getRightBorderColor()); dest.setRotation(source.getRotation()); dest.setTopBorderColor(source.getTopBorderColor()); - dest.setVerticalAlignment(source.getVerticalAlignmentEnum()); + dest.setVerticalAlignment(source.getVerticalAlignment()); dest.setWrapText(source.getWrapText()); } diff --git a/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelCells.java b/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelCells.java index c9cb1edf6..6472df460 100644 --- a/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelCells.java +++ b/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelCells.java @@ -238,7 +238,7 @@ else if (pCells[1].getCellType() == CellType.NUMERIC) { public BigDecimal getValue() throws ExcelException { BigDecimal value = new BigDecimal(0); try { - CellType cType = pCells[1].getCellTypeEnum(); + CellType cType = pCells[1].getCellType(); switch (cType) { case FORMULA: String type = getFormulaType(); @@ -654,7 +654,7 @@ public void setColor(long value) throws ExcelException // 05/07/05 B@tero // System.out.println("Automatic color."); if ((red + green + blue) != 0) { - newColor = new XSSFColor(new java.awt.Color(red, green, blue)); + newColor = new XSSFColor(new java.awt.Color(red, green, blue), new DefaultIndexedColorMap()); newFont = (XSSFFont) pWorkbook.createFont(); copyPropertiesFont(newFont, fontCell); @@ -672,7 +672,7 @@ public void setColor(long value) throws ExcelException // 05/07/05 B@tero byte[] triplet = fontColor.getRGB(); if (triplet[0] != red || triplet[1] != green || triplet[2] != blue) { - newColor = new XSSFColor(new java.awt.Color(red, green, blue)); + newColor = new XSSFColor( new java.awt.Color(red, green, blue), new DefaultIndexedColorMap()); newFont = (XSSFFont) pWorkbook.createFont(); copyPropertiesFont(newFont, fontCell); @@ -927,7 +927,7 @@ public Boolean setCellStyle(ExcelStyle newCellStyle) { } private XSSFColor toColor(ExcelColor color) { - return new XSSFColor(new java.awt.Color(color.getRed(), color.getGreen(), color.getBlue())); + return new XSSFColor( new java.awt.Color(color.getRed(), color.getGreen(), color.getBlue()), new DefaultIndexedColorMap()); } private XSSFCellStyle applyNewCellStyle(XSSFCellStyle cellStyle, ExcelStyle newCellStyle) { diff --git a/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelSpreadsheet.java b/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelSpreadsheet.java index 0ad09c36b..6cd6cb5ea 100644 --- a/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelSpreadsheet.java +++ b/gxoffice/src/main/java/com/genexus/msoffice/excel/poi/xssf/ExcelSpreadsheet.java @@ -314,7 +314,7 @@ private Boolean deleteColumnImpl(XSSFSheet sheet, int columnToDelete) { } Cell cNext = row.getCell(cID + 1); if (cNext != null) { - Cell cNew = row.createCell(cID, cNext.getCellTypeEnum()); + Cell cNew = row.createCell(cID, cNext.getCellType()); cloneCell(cNew, cNext); //Set the column width only on the first row. //Other wise the second row will overwrite the original column width set previously. @@ -363,7 +363,7 @@ public void insertNewColumnBefore(XSSFSheet sheet, int columnIndex) { Cell leftCell = r.getCell(col - 1); if (leftCell != null) { - Cell newCell = r.createCell(col, leftCell.getCellTypeEnum()); + Cell newCell = r.createCell(col, leftCell.getCellType()); cloneCell(newCell, leftCell); /*if (newCell.getCellTypeEnum() == CellType.FORMULA) { newCell.setCellFormula(ExcelHelper.updateFormula(newCell.getCellFormula(), columnIndex)); diff --git a/gxsearch/pom.xml b/gxsearch/pom.xml index 4db642096..53945ca61 100644 --- a/gxsearch/pom.xml +++ b/gxsearch/pom.xml @@ -22,17 +22,17 @@ org.apache.poi poi-scratchpad - 4.1.2 + ${poi.version} org.apache.poi poi-ooxml - 4.1.2 + ${poi.version} org.apache.poi poi - 4.1.2 + ${poi.version} commons-codec diff --git a/pom.xml b/pom.xml index e6f18be6f..bea81fac5 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ 2.34 3.0.1 2.12.5 + 5.2.2 4.13.2