Skip to content

Commit

Permalink
Fixed bug in SetRowHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
RNoeldner committed Apr 6, 2023
1 parent e1608e4 commit d9cc0ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
14 changes: 8 additions & 6 deletions Library/ClassLibraryCSV/FileReader/CsvFileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,15 +1042,17 @@ private char ReadChar()
MoveNext(peekNextChar);

// handling for "" that is not only representing a " but also closes the text
peekNextChar = Peek();
if (m_ContextSensitiveQualifier && (peekNextChar == m_FieldDelimiter
|| peekNextChar == cCr || peekNextChar == cLf)) postData = true;
if (m_ContextSensitiveQualifier)
{
peekNextChar = Peek();
if (peekNextChar == m_FieldDelimiter || peekNextChar == cCr || peekNextChar == cLf)
postData = true;
}
continue;
}

// a single " should be regarded as closing when its followed by the delimiter
if (m_ContextSensitiveQualifier && (peekNextChar == m_FieldDelimiter
|| peekNextChar == cCr || peekNextChar == cLf))
if (m_ContextSensitiveQualifier && (peekNextChar == m_FieldDelimiter || peekNextChar == cCr || peekNextChar == cLf))
{
postData = true;
continue;
Expand Down Expand Up @@ -1207,7 +1209,7 @@ public new async ValueTask DisposeAsync()
{
await DisposeAsyncCore();

Dispose(false);
Dispose(false);
}

protected async ValueTask DisposeAsyncCore()
Expand Down
3 changes: 3 additions & 0 deletions Library/ClassLibraryCSV/FileReader/DataReaderWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -265,6 +266,7 @@ public override DataTable GetSchemaTable()
public override string GetString(int ordinal) => Convert.ToString(GetValue(ordinal)) ?? string.Empty;

/// <inheritdoc />
[DebuggerStepThrough]
public override object GetValue(int ordinal)
{
if (ordinal == ReaderMapping.ColNumStartLine)
Expand All @@ -286,6 +288,7 @@ public override int GetValues(object[] values)
=> DataReader.GetValues(values);

/// <inheritdoc />
[DebuggerStepThrough]
public override bool IsDBNull(int ordinal)
{
if (ordinal == ReaderMapping.ColNumStartLine || ordinal == ReaderMapping.ColNumEndLine ||
Expand Down
2 changes: 1 addition & 1 deletion Library/WinFormControls/FilteredDataGridView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ private void SetRowHeight()
.Where(column => column.Visible && column.ValueType == typeof(string)).ToList();

var visibleRowsCount = DisplayedRowCount(true);
var firstDisplayedRowIndex = FirstDisplayedCell.RowIndex;
var firstDisplayedRowIndex = FirstDisplayedCell?.RowIndex ?? 0;

for (int rowIndex = firstDisplayedRowIndex; rowIndex < firstDisplayedRowIndex + visibleRowsCount; rowIndex++)
Rows[rowIndex].Height = GetDesiredRowHeight(Rows[rowIndex], visible);
Expand Down

0 comments on commit d9cc0ce

Please sign in to comment.