From 2a2c065222cd1d2b85a6765bac25e233ebf132ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20S=CC=8Colte=CC=81s?= Date: Sat, 9 Mar 2024 14:31:30 +0100 Subject: [PATCH] Update --- Directory.Build.props | 20 +++---- NuGet.Config | 1 - global.json | 2 +- src/Core2D/Core2D.csproj | 2 +- .../TextFieldReader/OpenXml/OpenXmlReader.cs | 52 ++++++++----------- .../TextFieldWriter/OpenXml/OpenXmlWriter.cs | 2 +- 6 files changed, 36 insertions(+), 43 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9b4c100612..9b60c66881 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,10 +15,10 @@ 1.0.3 7.0.0 7.0.3 - 7.1.0 + 8.0.0 8.2.2 - 30.0.1 - 2.20.0 + 31.0.2 + 3.0.1 4.7.0 2.4.0 13.0.3 @@ -31,12 +31,12 @@ 2.4.1 2.0.3 16.2.0 - 2.88.6 - 1.0.0.3 - 11.0.5 - 11.0.2 - 11.0.0 - 11.0.0 - 11.0.0.2 + 2.88.7 + 1.0.0.14 + 11.0.10 + 11.0.10 + 11.0.0.3 + 11.0.0.1 + 11.0.0.6 diff --git a/NuGet.Config b/NuGet.Config index aa6ce73a93..631250a465 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -3,7 +3,6 @@ - diff --git a/global.json b/global.json index 918ec81ddd..7865629941 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "latestMinor", "allowPrerelease": true } diff --git a/src/Core2D/Core2D.csproj b/src/Core2D/Core2D.csproj index 72d17376b8..3d18ef329a 100644 --- a/src/Core2D/Core2D.csproj +++ b/src/Core2D/Core2D.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 WinExe True enable diff --git a/src/Core2D/Modules/TextFieldReader/OpenXml/OpenXmlReader.cs b/src/Core2D/Modules/TextFieldReader/OpenXml/OpenXmlReader.cs index 859301ca8c..4dbfdfbbe9 100644 --- a/src/Core2D/Modules/TextFieldReader/OpenXml/OpenXmlReader.cs +++ b/src/Core2D/Modules/TextFieldReader/OpenXml/OpenXmlReader.cs @@ -31,37 +31,31 @@ public OpenXmlReader(IServiceProvider? serviceProvider) return c.CellValue?.Text; } - switch (c.DataType.Value) + if (c.DataType.Value == CellValues.SharedString) { - case CellValues.SharedString: + if (stringTable is not null) { - if (stringTable is { }) - { - int index = int.Parse(c.InnerText); - var value = stringTable.SharedStringTable.ElementAt(index).InnerText; - return value; - } + int index = int.Parse(c.InnerText); + var value = stringTable.SharedStringTable.ElementAt(index).InnerText; + return value; } - break; - case CellValues.Boolean: - { - return c.InnerText switch - { - "0" => "FALSE", - _ => "TRUE", - }; - } - case CellValues.Number: - return c.InnerText; - case CellValues.Error: - return c.InnerText; - case CellValues.String: - return c.InnerText; - case CellValues.InlineString: - return c.InnerText; - case CellValues.Date: - return c.InnerText; } + else if (c.DataType.Value == CellValues.Boolean) + return c.InnerText switch + { + "0" => "FALSE", + _ => "TRUE", + }; + else if (c.DataType.Value == CellValues.Number) + return c.InnerText; + else if (c.DataType.Value == CellValues.Error) + return c.InnerText; + else if (c.DataType.Value == CellValues.String) + return c.InnerText; + else if (c.DataType.Value == CellValues.InlineString) + return c.InnerText; + else if (c.DataType.Value == CellValues.Date) + return c.InnerText; return null; } @@ -88,7 +82,7 @@ public OpenXmlReader(IServiceProvider? serviceProvider) yield return fields; } - spreadsheetDocument.Close(); + spreadsheetDocument.Dispose(); } public DatabaseViewModel? Read(Stream stream) @@ -109,4 +103,4 @@ public OpenXmlReader(IServiceProvider? serviceProvider) return _serviceProvider.GetService()?.FromFields(name, fields); } -} \ No newline at end of file +} diff --git a/src/Core2D/Modules/TextFieldWriter/OpenXml/OpenXmlWriter.cs b/src/Core2D/Modules/TextFieldWriter/OpenXml/OpenXmlWriter.cs index 771fb28bf6..0928c8a8d4 100644 --- a/src/Core2D/Modules/TextFieldWriter/OpenXml/OpenXmlWriter.cs +++ b/src/Core2D/Modules/TextFieldWriter/OpenXml/OpenXmlWriter.cs @@ -182,7 +182,7 @@ public static void Write(Stream stream, object[,] values, uint nRows, uint nColu WriteTable(worksheetPart, 1U, values, nRows, nColumns); workbookPart.Workbook.Save(); - spreadsheetDocument.Close(); + spreadsheetDocument.Dispose(); } public void Write(Stream stream, DatabaseViewModel? database)