Skip to content

Commit

Permalink
Add rangeBase annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
omaus committed Mar 21, 2023
1 parent ec3aca9 commit 440b213
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/FsSpreadsheet/Ranges/FsRangeBase.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type FsRangeBase (rangeAddress : FsRangeAddress, styleValue) =
IdCounter <- IdCounter + 1
IdCounter

new (rangeAddress) = FsRangeBase(rangeAddress,null)
new (rangeAddress) = FsRangeBase(rangeAddress, null)

//abstract member OnRangeAddressChanged : FsRangeAddress*FsRangeAddress -> unit

Expand All @@ -34,7 +34,8 @@ type FsRangeBase (rangeAddress : FsRangeAddress, styleValue) =
_rangeAddress <- rangeAdress
//OnRangeAddressChanged(oldAddress, _rangeAddress);

member self.Cell(cellAddressInRange : FsAddress,cells : FsCellsCollection) =
// TO DO: add description – important and complex function
member self.Cell(cellAddressInRange : FsAddress, cells : FsCellsCollection) =

let absRow = cellAddressInRange.RowNumber + self.RangeAddress.FirstAddress.RowNumber - 1;
let absColumn = cellAddressInRange.ColumnNumber + self.RangeAddress.FirstAddress.ColumnNumber - 1;
Expand All @@ -45,7 +46,7 @@ type FsRangeBase (rangeAddress : FsRangeAddress, styleValue) =
if (absColumn <= 0 || absColumn > 16384) then
failwithf "Column number must be between 1 and %i" cells.MaxColumnNumber

let cell = cells.TryGetCell(absRow,absColumn);
let cell = cells.TryGetCell(absRow, absColumn)

match cell with
| Some cell ->
Expand All @@ -71,7 +72,7 @@ type FsRangeBase (rangeAddress : FsRangeAddress, styleValue) =

self.Extend(absoluteAddress)

cells.Add(absRow, absColumn, newCell);
cells.Add(absRow, absColumn, newCell) |> ignore
newCell

member self.Cells(cells : FsCellsCollection) =
Expand Down

0 comments on commit 440b213

Please sign in to comment.