addFormulaForPostProcessing(templateRange, newRow, templateCell, newCell);
}
resultCells.add(newCell);
CellReference tempRef = new CellReference(templateRange.getSheet(), templateCell);
CellReference newRef = new CellReference(templateRange.getSheet(), newCell.getR());
newRef.move(newRow.getR().intValue(), newRef.getColumn());
if (bandData.getOrientation() == BandOrientation.VERTICAL) {
newRef.shift(0, previousRangesRightOffset);
}
newCell.setR(newRef.toReference());
newRow.getC().add(newCell);
newCell.setParent(newRow);
WorksheetPart worksheetPart = null;
for (Document.SheetWrapper sheetWrapper : result.getWorksheets()) {
if (sheetWrapper.getWorksheet().getJaxbElement() == resultWorksheet) {
worksheetPart = sheetWrapper.getWorksheet();
}
}
updateCell(worksheetPart, bandData, newCell);
Col templateColumn = template.getColumnForCell(templateRange.getSheet(), tempRef);
Col resultColumn = result.getColumnForCell(templateRange.getSheet(), newRef);
if (templateColumn != null && resultColumn == null) {
resultColumn = XmlUtils.deepCopy(templateColumn, Context.jcSML);
resultColumn.setMin(newRef.getColumn());
resultColumn.setMax(newRef.getColumn());
resultWorksheet.getCols().get(0).getCol().add(resultColumn);
}
}
return resultCells;
}