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]);}
public CellReference[] GetAllReferencedCells(){if (_isSingleCell){return new CellReference[] { _firstCell, };}int minRow = Math.Min(_firstCell.Row, _lastCell.Row);int maxRow = Math.Max(_firstCell.Row, _lastCell.Row);int minCol = Math.Min(_firstCell.Col, _lastCell.Col);int maxCol = Math.Max(_firstCell.Col, _lastCell.Col);String sheetName = _firstCell.SheetName;ArrayList refs = new ArrayList();for (int row = minRow; row <= maxRow; row++){for (int col = minCol; col <= maxCol; col++){CellReference ref1 = new CellReference(sheetName, row, col, _firstCell.IsRowAbsolute, _firstCell.IsColAbsolute);refs.Add(ref1);}}return (CellReference[])refs.ToArray(typeof(CellReference));}