From 0abafeab54322ef74808cc8b23f42e762768da9a Mon Sep 17 00:00:00 2001 From: omaus Date: Wed, 8 Mar 2023 22:34:33 +0100 Subject: [PATCH] Add method to more easily add FsCells --- src/FsSpreadsheet/Cells/FsCellsCollection.fs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/FsSpreadsheet/Cells/FsCellsCollection.fs b/src/FsSpreadsheet/Cells/FsCellsCollection.fs index aee86784..3958ecbf 100644 --- a/src/FsSpreadsheet/Cells/FsCellsCollection.fs +++ b/src/FsSpreadsheet/Cells/FsCellsCollection.fs @@ -91,7 +91,7 @@ type FsCellsCollection() = // Add(sheetPoint.Row, sheetPoint.Column, cell); //} - /// Adds an FsCell of given rowIndex and columnIndex to the FsCellsCollection. + /// Adds an FsCell of given rowIndex and columnIndex to the FsCellsCollection. member this.Add(row : int32, column : int32, cell : FsCell) = _count <- _count + 1 @@ -122,6 +122,11 @@ type FsCellsCollection() = static member add rowIndex colIndex (cell : FsCell) (cellsCollection : FsCellsCollection) = cellsCollection.Add(rowIndex, colIndex, cell) + /// Adds an FsCell to the FsCellsCollection. + /// Derives row- and columnIndex from the FsAddress of the FsCell. + member self.Add(cell : FsCell) = + self.Add(cell.Address.RowNumber, cell.Address.ColumnNumber, cell) + /// Checks if an FsCell exists at given row- and columnIndex. member this.ContainsCellAt(rowIndex, colIndex) = match Dictionary.tryGet rowIndex _rowsCollection with