Skip to content

Commit

Permalink
[fix] when first row(s) is empty, query return data will not contain …
Browse files Browse the repository at this point in the history
…the empty row(s) (#578)

Co-authored-by: hansen <[email protected]>
  • Loading branch information
huangsunyang and hansen authored Mar 31, 2024
1 parent b27b169 commit 9e3f1bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/MiniExcel/OpenXml/ExcelOpenXmlSheetReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,12 @@ public IEnumerable<IDictionary<string, object>> Query(bool useHeaderRow, string
}

// fill empty rows
if (!(nextRowIndex < startRowIndex))
var expectedRowIndex = isFirstRow ? startRowIndex : nextRowIndex;
if (!(expectedRowIndex < startRowIndex))
{
if (nextRowIndex < rowIndex)
if (expectedRowIndex < rowIndex)
{
for (int i = nextRowIndex; i < rowIndex; i++)
for (int i = expectedRowIndex; i < rowIndex; i++)
{
yield return GetCell(useHeaderRow, maxColumnIndex, headRows, startColumnIndex);
}
Expand Down

0 comments on commit 9e3f1bd

Please sign in to comment.