String textContent = result.getTextContent();
LOG.atDebug().log("Extracting with xpath {} : value is '{}'", xpathString, textContent);
XSSFCell cell = singleXmlCell.getReferencedCell();
- LOG.atDebug().log("Setting '{}' to cell {}-{} in sheet {}", textContent, box(cell.getColumnIndex()),box(cell.getRowIndex()),cell.getSheet().getSheetName());
+ LOG.atDebug().log("Setting '{}' to cell {}-{} in sheet {}", textContent,
+ box(cell.getColumnIndex()), box(cell.getRowIndex()), cell.getSheet().getSheetName());
setCellValue(textContent, cell, xmlDataType);
}
}
if (cell == null) {
cell = row.createCell(columnId);
}
- LOG.atDebug().log("Setting '{}' to cell {}-{} in sheet {}", value, box(cell.getColumnIndex()),box(cell.getRowIndex()),table.getXSSFSheet().getSheetName());
+ LOG.atDebug().log("Setting '{}' to cell {}-{} in sheet {}", value,
+ box(cell.getColumnIndex()), box(cell.getRowIndex()), table.getXSSFSheet().getSheetName());
setCellValue(value, cell, xmlColumnPr.getXmlDataType());
}
}
public Ptg[] getFormulaTokens(EvaluationCell evalCell) {
final XSSFCell cell = ((XSSFEvaluationCell)evalCell).getXSSFCell();
final int sheetIndex = _uBook.getSheetIndex(cell.getSheet());
- final int rowIndex = cell.getRowIndex();
- return FormulaParser.parse(cell.getCellFormula(this), this, FormulaType.CELL, sheetIndex, rowIndex);
+ return FormulaParser.parse(cell.getCellFormula(this), this,
+ FormulaType.CELL, sheetIndex, cell.getRowIndex());
}
}
}
/* package */ boolean isCellInArrayFormulaContext(XSSFCell cell) {
+ final int rowIndex = cell.getRowIndex();
+ final int columnIndex = cell.getColumnIndex();
for (CellRangeAddress range : arrayFormulas) {
- if (range.isInRange(cell.getRowIndex(), cell.getColumnIndex())) {
+ if (range.isInRange(rowIndex, columnIndex)) {
return true;
}
}
}
/* package */ XSSFCell getFirstCellInArrayFormula(XSSFCell cell) {
+ final int rowIndex = cell.getRowIndex();
+ final int columnIndex = cell.getColumnIndex();
for (CellRangeAddress range : arrayFormulas) {
- if (range.isInRange(cell.getRowIndex(), cell.getColumnIndex())) {
+ if (range.isInRange(rowIndex, columnIndex)) {
return getRow(range.getFirstRow()).getCell(range.getFirstColumn());
}
}
* @param cell The cell that is removed
* @param evalWb BaseXSSFEvaluationWorkbook in use, if one exists
*/
- protected void onDeleteFormula(XSSFCell cell, BaseXSSFEvaluationWorkbook evalWb){
-
+ protected void onDeleteFormula(final XSSFCell cell, final BaseXSSFEvaluationWorkbook evalWb) {
+ final int rowIndex = cell.getRowIndex();
+ final int columnIndex = cell.getColumnIndex();
CTCellFormula f = cell.getCTCell().getF();
if (f != null && f.getT() == STCellFormulaType.SHARED && f.isSetRef() && f.getStringValue() != null) {
CellRangeAddress ref = CellRangeAddress.valueOf(f.getRef());
if(ref.getNumberOfCells() > 1){
DONE:
- for(int i = cell.getRowIndex(); i <= ref.getLastRow(); i++){
+ for(int i = rowIndex; i <= ref.getLastRow(); i++){
XSSFRow row = getRow(i);
if(row != null) {
- for(int j = cell.getColumnIndex(); j <= ref.getLastColumn(); j++){
+ for(int j = columnIndex; j <= ref.getLastColumn(); j++){
XSSFCell nextCell = row.getCell(j);
if(nextCell != null && nextCell != cell && nextCell.getCellType() == CellType.FORMULA) {
CTCellFormula nextF = nextCell.getCTCell().getF();