Skip to content

Commit

Permalink
use getRunVar() for internal vars
Browse files Browse the repository at this point in the history
  • Loading branch information
SoltauFintel committed Dec 22, 2023
1 parent 872e3bc commit 079636b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>) context.getVar(CellData.CELL_STYLE_MAP), transformer);
if (Boolean.TRUE.equals(context.getRunVar(CellData.IGNORE_SOURCE_CELL_STYLE) )) {
CellStyle dataFormatCellStyle = findCellStyle(evaluationResult, (Map<String, String>) context.getRunVar(CellData.CELL_STYLE_MAP), transformer);
if (dataFormatCellStyle != null) {
targetCellStyle = dataFormatCellStyle;
}
Expand Down
4 changes: 2 additions & 2 deletions jxls/src/main/java/org/jxls/area/XlsArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions jxls/src/main/java/org/jxls/command/GridCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> oldStyleCellMap = (Map<String, String>) context.getVar(CellData.CELL_STYLE_MAP);
Map<String, String> oldStyleCellMap = (Map<String, String>) 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) {
Expand Down

0 comments on commit 079636b

Please sign in to comment.