Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
warning-explosive committed Dec 1, 2023
1 parent e6a029b commit 0cab31c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Modules/DataExport/DataExport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DocumentFormat.OpenXml" Version="2.20.0" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\Basics\Basics.csproj"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/DataImport/DataImport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DocumentFormat.OpenXml" Version="2.20.0" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Common\Basics\Basics.csproj"/>
Expand Down
26 changes: 14 additions & 12 deletions src/Modules/DataImport/Excel/ExcelCellValueExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ public ExcelCellValue ExtractCellValue(

string? value;

switch (cell.DataType?.Value ?? CellValues.String)
var cellValue = cell.DataType?.Value ?? CellValues.String;

if (cellValue.Equals(CellValues.InlineString))
{
value = cell.InnerText;
}
else if (cellValue.Equals(CellValues.SharedString))
{
value = cell.CellValue != null
? sharedStrings[int.Parse(cell.CellValue.Text, CultureInfo.InvariantCulture)]
: null;
}
else
{
case CellValues.InlineString:
value = cell.InnerText;
break;
case CellValues.SharedString:
value = cell.CellValue != null
? sharedStrings[int.Parse(cell.CellValue.Text, CultureInfo.InvariantCulture)]
: null;
break;
default:
value = cell.CellValue?.Text;
break;
value = cell.CellValue?.Text;
}

if (value != null)
Expand Down

0 comments on commit 0cab31c

Please sign in to comment.