Skip to content

Commit

Permalink
excel: only set active cell if not null
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOellerer committed Jun 5, 2024
1 parent 62e4b46 commit f651da0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'com.docutools'
version = '2.0.1'
version = '2.0.2'

java {
toolchain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.ss.usermodel.Cell;
Expand Down Expand Up @@ -109,7 +110,7 @@ public void newSheet(Sheet sheet) {
logger.info("Creating new sheet of {}", sheet.getSheetName());
templateSheet = sheet;
currentSheet = workbook.createSheet(sheet.getSheetName());
currentSheet.setActiveCell(sheet.getActiveCell());
Optional.ofNullable(sheet.getActiveCell()).ifPresent(activeCell -> currentSheet.setActiveCell(activeCell));
currentSheet.setAutobreaks(sheet.getAutobreaks());
Arrays.stream(sheet.getColumnBreaks()).forEach(column -> currentSheet.setColumnBreak(column));
currentSheet.setDefaultColumnWidth(sheet.getDefaultColumnWidth());
Expand Down

0 comments on commit f651da0

Please sign in to comment.