Skip to content

Commit

Permalink
Merge pull request #39 from lukos/notalltrains
Browse files Browse the repository at this point in the history
Fix incorrect import
  • Loading branch information
lukos authored Feb 24, 2022
2 parents 9d7a331 + 51e2ec0 commit 6b66ea4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SimsigImporterLibrary/SpreadsheetHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ private List<Timetable> ProcessTimetable(SpreadsheetDocument doc, Sheet ttSheet,
}

var timetables = new List<Timetable>();
var columnCount = worksheet.Descendants<Row>().FirstOrDefault()?.ChildElements.Count;
for (int workCol = workingColumn; workCol <= columnCount.GetValueOrDefault(); ++workCol)
var columnCount = worksheet.Descendants<Row>().Max(r => r.ChildElements.Count);
for (int workCol = workingColumn; workCol <= columnCount; ++workCol)
{
// Attempt to process a timetable in each column on the sheet. Note that it is possible there are extra blank columns
// and others with random stuff so just look for headcode content
Expand Down

0 comments on commit 6b66ea4

Please sign in to comment.