Skip to content

Commit

Permalink
implement HSSFSheet.GetCells
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyqus committed Dec 12, 2024
1 parent f17c068 commit 6b57bc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main/HSSF/Model/InternalSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2022,15 +2022,15 @@ public bool IsUncalced
/// If requested, will Create a new DrawRecord if none currently exist
/// </summary>
/// <param name="drawingManager">The DrawingManager2 for our workbook</param>
/// <param name="CreateIfMissing">Should one be Created if missing?</param>
/// <param name="createIfMissing">Should one be Created if missing?</param>
/// <returns>location of EscherAggregate record. if no EscherAggregate record is found return -1</returns>
public int AggregateDrawingRecords(DrawingManager2 drawingManager, bool CreateIfMissing)
public int AggregateDrawingRecords(DrawingManager2 drawingManager, bool createIfMissing)
{
int loc = FindFirstRecordLocBySid(DrawingRecord.sid);
bool noDrawingRecordsFound = (loc == -1);
if (noDrawingRecordsFound)
{
if (!CreateIfMissing)
if (!createIfMissing)
{
// None found, and not allowed to Add in
return -1;
Expand Down
9 changes: 9 additions & 0 deletions main/HSSF/UserModel/HSSFSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3401,6 +3401,15 @@ public ICellRange<ICell> GetCells(string range)
firstRow = startCellAddress.Row;
height = rangeAddress.Height;
width = rangeAddress.Width;
for(int i = firstRow; i < height; i++)
{
for(int j = firstColumn; j < width; j++)
{
var row = this.GetRow(i) ?? CreateRow(i);
var cell = row.GetCell(j) ?? row.CreateCell(j);
cells.Add(cell);
}
}
}
else
{
Expand Down

0 comments on commit 6b57bc7

Please sign in to comment.