Skip to content

Commit

Permalink
jxlsteam#305: bump apache.poi & commons-compress
Browse files Browse the repository at this point in the history
  • Loading branch information
uek06 committed Jul 16, 2024
1 parent db6ef04 commit 584a7e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions jxls-poi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description>Apache POI based Transformer implementation for Jxls library</description>

<properties>
<poi.version>5.2.2</poi.version>
<poi.version>5.2.4</poi.version>
</properties>

<dependencies>
Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.25.0</version>
<version>1.26.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
17 changes: 7 additions & 10 deletions jxls-poi/src/main/java/org/jxls/transform/poi/PoiSheetCreator.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package org.jxls.transform.poi;

import org.apache.poi.ss.usermodel.HeaderFooter;
import org.apache.poi.ss.usermodel.PrintSetup;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFHeaderFooterProperties;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
Expand Down Expand Up @@ -65,12 +62,12 @@ protected void copySheetSetup(Sheet src, Sheet dest) {
dest.setFitToPage(src.getFitToPage());
dest.setForceFormulaRecalculation(src.getForceFormulaRecalculation());
dest.setHorizontallyCenter(src.getHorizontallyCenter());
dest.setMargin(Sheet.LeftMargin, src.getMargin(Sheet.LeftMargin));
dest.setMargin(Sheet.RightMargin, src.getMargin(Sheet.RightMargin));
dest.setMargin(Sheet.TopMargin, src.getMargin(Sheet.TopMargin));
dest.setMargin(Sheet.BottomMargin, src.getMargin(Sheet.BottomMargin));
dest.setMargin(Sheet.HeaderMargin, src.getMargin(Sheet.HeaderMargin));
dest.setMargin(Sheet.FooterMargin, src.getMargin(Sheet.FooterMargin));
dest.setMargin(PageMargin.LEFT, src.getMargin(PageMargin.LEFT));
dest.setMargin(PageMargin.RIGHT, src.getMargin(PageMargin.RIGHT));
dest.setMargin(PageMargin.TOP, src.getMargin(PageMargin.TOP));
dest.setMargin(PageMargin.BOTTOM, src.getMargin(PageMargin.BOTTOM));
dest.setMargin(PageMargin.HEADER, src.getMargin(PageMargin.HEADER));
dest.setMargin(PageMargin.FOOTER, src.getMargin(PageMargin.FOOTER));
dest.setPrintGridlines(src.isPrintGridlines());
dest.setRowSumsBelow(src.getRowSumsBelow());
dest.setRowSumsRight(src.getRowSumsRight());
Expand Down
9 changes: 5 additions & 4 deletions jxls-poi/src/test/java/org/jxls3/MultiSheetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;
import java.util.Map;

import org.apache.poi.ss.usermodel.PageMargin;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.junit.Assert;
Expand Down Expand Up @@ -122,10 +123,10 @@ private void verifySheet(TestWorkbook w, String name) {
assertEquals("", sheet.getHeader().getRight());
assertEquals("A", sheet.getFooter().getLeft());
final double inch = 2.54d;
assertEquals(3d, sheet.getMargin(Sheet.LeftMargin) * inch, 0.05d); // 3 in the German Excel GUI
assertEquals(3d, sheet.getMargin(Sheet.RightMargin) * inch, 0.05d);
assertEquals(3d, sheet.getMargin(Sheet.TopMargin) * inch, 0.05d);
assertEquals(3d, sheet.getMargin(Sheet.BottomMargin) * inch, 0.05d);
assertEquals(3d, sheet.getMargin(PageMargin.LEFT) * inch, 0.05d); // 3 in the German Excel GUI
assertEquals(3d, sheet.getMargin(PageMargin.RIGHT) * inch, 0.05d);
assertEquals(3d, sheet.getMargin(PageMargin.TOP) * inch, 0.05d);
assertEquals(3d, sheet.getMargin(PageMargin.BOTTOM) * inch, 0.05d);
assertTrue(sheet.getPrintSetup().getNoColor());
assertEquals("1:1", sheet.getRepeatingRows().formatAsString()); // "$1:$1" in the Excel GUI
}
Expand Down

0 comments on commit 584a7e4

Please sign in to comment.