text: public CellReference[] getAllReferencedCells() {if(_isSingleCell) {return  new CellReference[] { _firstCell, };}int minRow = Math.min(_firstCell.getRow(), _lastCell.getRow());int maxRow = Math.max(_firstCell.getRow(), _lastCell.getRow());int minCol = Math.min(_firstCell.getCol(), _lastCell.getCol());int maxCol = Math.max(_firstCell.getCol(), _lastCell.getCol());String sheetName = _firstCell.getSheetName();List<CellReference> refs = new ArrayList<>();for(int row=minRow; row<=maxRow; row++) {for(int col=minCol; col<=maxCol; col++) {CellReference ref = new CellReference(sheetName, row, col, _firstCell.isRowAbsolute(), _firstCell.isColAbsolute());refs.add(ref);}}return refs.toArray(new CellReference[0]);}