From 079636b022fd51eb0fef9eea33522fc86070c49d Mon Sep 17 00:00:00 2001 From: Marcus Warm Date: Fri, 22 Dec 2023 16:56:35 +0100 Subject: [PATCH] use getRunVar() for internal vars --- .../src/main/java/org/jxls/transform/poi/PoiCellData.java | 4 ++-- jxls/src/main/java/org/jxls/area/XlsArea.java | 4 ++-- jxls/src/main/java/org/jxls/command/GridCommand.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jxls-poi/src/main/java/org/jxls/transform/poi/PoiCellData.java b/jxls-poi/src/main/java/org/jxls/transform/poi/PoiCellData.java index 848cc7d2..8737b4b0 100644 --- a/jxls-poi/src/main/java/org/jxls/transform/poi/PoiCellData.java +++ b/jxls-poi/src/main/java/org/jxls/transform/poi/PoiCellData.java @@ -149,8 +149,8 @@ public void writeToCell(Cell cell, Context context, PoiTransformer transformer) updateCellGeneralInfo(cell); updateCellContents(cell); CellStyle targetCellStyle = cellStyle; - if (Boolean.TRUE.equals(context.getVar(CellData.IGNORE_SOURCE_CELL_STYLE) )) { - CellStyle dataFormatCellStyle = findCellStyle(evaluationResult, (Map) context.getVar(CellData.CELL_STYLE_MAP), transformer); + if (Boolean.TRUE.equals(context.getRunVar(CellData.IGNORE_SOURCE_CELL_STYLE) )) { + CellStyle dataFormatCellStyle = findCellStyle(evaluationResult, (Map) context.getRunVar(CellData.CELL_STYLE_MAP), transformer); if (dataFormatCellStyle != null) { targetCellStyle = dataFormatCellStyle; } diff --git a/jxls/src/main/java/org/jxls/area/XlsArea.java b/jxls/src/main/java/org/jxls/area/XlsArea.java index 54cb1171..23434980 100644 --- a/jxls/src/main/java/org/jxls/area/XlsArea.java +++ b/jxls/src/main/java/org/jxls/area/XlsArea.java @@ -232,7 +232,7 @@ public Size applyAt(CellRef cellRef, Context context) { transformStaticCells(cellRef, context, commandsArea); fireAfterApplyEvent(cellRef, context); Size finalSize = new Size(cellRange.calculateWidth(), cellRange.calculateHeight()); - if (Boolean.TRUE.equals(context.getVar(IS_FORMULA_PROCESSING_REQUIRED))) { + if (Boolean.TRUE.equals(context.getRunVar(IS_FORMULA_PROCESSING_REQUIRED))) { AreaRef newAreaRef = new AreaRef(cellRef, finalSize); updateCellDataFinalAreaForFormulaCells(newAreaRef); } @@ -525,7 +525,7 @@ private void transformStaticCells(CellRef cellRef, Context context, } private void updateCellDataArea(CellRef srcCell, CellRef targetCell, Context context) { - if (!Boolean.TRUE.equals(context.getVar(IS_FORMULA_PROCESSING_REQUIRED))) { + if (!Boolean.TRUE.equals(context.getRunVar(IS_FORMULA_PROCESSING_REQUIRED))) { return; } CellData cellData = transformer.getCellData(srcCell); diff --git a/jxls/src/main/java/org/jxls/command/GridCommand.java b/jxls/src/main/java/org/jxls/command/GridCommand.java index 46a06fbf..7071615e 100644 --- a/jxls/src/main/java/org/jxls/command/GridCommand.java +++ b/jxls/src/main/java/org/jxls/command/GridCommand.java @@ -164,9 +164,9 @@ private Size processBody(final CellRef cellRef, Context context) { CellRef currentCell = cellRef; int totalWidth = 0; int totalHeight = 0; - Boolean oldIgnoreSourceCellStyle = (Boolean) context.getVar(CellData.IGNORE_SOURCE_CELL_STYLE); + Boolean oldIgnoreSourceCellStyle = (Boolean) context.getRunVar(CellData.IGNORE_SOURCE_CELL_STYLE); context.putVar(CellData.IGNORE_SOURCE_CELL_STYLE, Boolean.TRUE); - Map oldStyleCellMap = (Map) context.getVar(CellData.CELL_STYLE_MAP); + Map oldStyleCellMap = (Map) context.getRunVar(CellData.CELL_STYLE_MAP); context.putVar(CellData.CELL_STYLE_MAP, this.cellStyleMap); // TODO possible error: content of DATA_VAR is not saved & restored for (Object rowObject : dataCollection) {