Skip to content

Commit 2d2abf2

Browse files
committed
fix tests
1 parent 77443c5 commit 2d2abf2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

SharpExcel/Exporters/BaseSharpExcelSynchronizer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,12 @@ private static int FindAndMapHeaderRow(
232232
.Any(c => headerNames.Contains(c.Value.ToString().ToLowerInvariant())))
233233
.FirstOrDefault()?.WorksheetRow();
234234

235+
var headerRowId = headerRow!.RowNumber();
236+
235237
var propertiesByColumnName = instance.Properties.PropertyMappings.ToDictionary(x => x.NormalizedName);
236238

237239
var startIndex = usedArea.FirstCell().WorksheetColumn().ColumnNumber();
238240

239-
240-
241241
if (rule.Column != null && rule.Column > startIndex)
242242
startIndex = rule.Column ?? 1;
243243

@@ -262,7 +262,7 @@ private static int FindAndMapHeaderRow(
262262
}
263263
}
264264

265-
return headerRow!.RowNumber() - 1;
265+
return headerRowId <= 1 ? 2 : headerRowId - 1;
266266
}
267267

268268
/// <summary>

0 commit comments

Comments
 (0)