Skip to content

Commit

Permalink
use CellValue instead of InnerText
Browse files Browse the repository at this point in the history
  • Loading branch information
mikheev.a committed Apr 29, 2022
1 parent 69b22f4 commit 5602541
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Excel.TemplateEngine/ObjectPrinting/LazyParse/LazyRowReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public SimpleCell TryReadCell([NotNull] ICellPosition cellPosition)
private SimpleCell ToSimpleCell([NotNull] Cell cell)
{
var cellIndex = new CellPosition(cell.CellReference);
var cellString = cell.InnerText;
if (cell.DataType?.Value == CellValues.SharedString)
var cellValue = cell.CellValue?.InnerText;
if (cell.DataType?.Value == CellValues.SharedString && cellValue != null)
{
var i = int.Parse(cell.InnerText);
cellString = sharedStrings[i];
var i = int.Parse(cellValue);
cellValue = sharedStrings[i];
}

return new SimpleCell(cellIndex, cellString);
return new SimpleCell(cellIndex, cellValue);
}

public void Dispose()
Expand Down
4 changes: 2 additions & 2 deletions Excel.TemplateEngine/ObjectPrinting/LazyParse/SimpleCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SkbKontur.Excel.TemplateEngine.ObjectPrinting.LazyParse
{
public class SimpleCell
{
public SimpleCell([NotNull] ICellPosition cellPosition, [NotNull] string cellValue)
public SimpleCell([NotNull] ICellPosition cellPosition, [CanBeNull] string cellValue)
{
CellPosition = cellPosition;
CellValue = cellValue;
Expand All @@ -15,7 +15,7 @@ public SimpleCell([NotNull] ICellPosition cellPosition, [NotNull] string cellVal
[NotNull]
public ICellPosition CellPosition { get; }

[NotNull]
[CanBeNull]
public string CellValue { get; }
}
}

0 comments on commit 5602541

Please sign in to comment.