removeColumn method
Remove column in sheet
at position columnIndex
Implementation
@override
void removeColumn(String sheet, int columnIndex) {
super.removeColumn(sheet, columnIndex);
for (var row in _findRows(_sheets[sheet]!)) {
XmlElement? cell;
var cells = _findCells(row);
var currentIndex = 0; // cells could be empty
for (var currentCell in cells) {
currentIndex = _getCellNumber(currentCell) - 1;
if (currentIndex >= columnIndex) {
cell = currentCell;
break;
}
}
if (cell != null) {
cells
.skipWhile((c) => c != cell)
.forEach((c) => _setCellColNumber(c, _getCellNumber(c) - 1));
cell.parent!.children.remove(cell);
}
}
}