Skip to content

Commit e7f94a0

Browse files
michelebastioneshps951023izanhzh
authored
Big refactoring before first beta release (#821)
* Refactoring first draft - Bumped language version to 13 - Added suuport for nullable reference types - Changed block scoped namespaces to file scoped - Changed MiniExcelLibs.OpenXml.SaveByTemplate to MiniExcelLibs.SaveByTemplate - Changed using statements to using declarations where possible and appropriate - Implemented collections expressions where possible and appropriate - Chanegd == null and != null checks to is null and is not null - Implemented pattern matching and primary constructors where possible and appropriate - Removed License code file - Added the TaskHelper class - Renamed OpenXml.Config class to OpenXml.Constants.Schemas - Renamed IConfiguration and Configuration classes to IMiniExcelConfiguration and MiniExcelConfiguration - Renamed calChainHelper.cs file to CalcChainHelper.cs - Minor style changes (sorting modifiers, renaming variables, etc...) * 1 41 3 fix bugs (#818) * v1.41.2 AddPicture not working #814 * #814 samples * Fix v1.41.1 AddPicture image max column and row are 2 cells #815 * Fix AddPicture get error same export file and second time. #817 --------- Signed-off-by: Wei Lin <[email protected]> (cherry picked from commit 1103aed) * Bugfix for AddPicture method - Fixes issues 814, 815 and 817 - Upgrades ClosedXml and Epplus packages in test project - Adds EpplusLicense class that specifies the context as non commercial - Resolves conflicting targetframeworks in main csproj and bumps version to 2.0.0-beta.1 - Addds codeql analysis to pushes and prs of maintenance branch - Fixes typo in drawio diagram Co-Authored-By: Wei Lin <[email protected]> * Remove `MiniExcelTask.cs` * fix docs description * Add configuration items to `.editorconfig` --------- Co-authored-by: Wei Lin <[email protected]> Co-authored-by: izanhzh <[email protected]>
1 parent b00b045 commit e7f94a0

File tree

254 files changed

+11081
-9414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+11081
-9414
lines changed

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ dotnet_diagnostic.CA2007.severity = error
2828

2929
# CA2016: Forward the CancellationToken parameter to methods that take one
3030
dotnet_diagnostic.CA2016.severity = error
31+
32+
csharp_style_namespace_declarations = file_scoped:silent

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ master, v1.x-maintenance ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ master, v1.x-maintenance ]
2020
schedule:
2121
- cron: '18 0 * * 0'
2222

MiniExcel.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs and setting", "Docs an
1818
README.zh-Hant.md = README.zh-Hant.md
1919
.github\workflows\benchmark.yml = .github\workflows\benchmark.yml
2020
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
21+
docs\core_logic_diagram.drawio = docs\core_logic_diagram.drawio
2122
EndProjectSection
2223
EndProject
2324
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CC1E0601-AEC9-42D7-8F6A-3FB3939EED16}"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,8 @@ MiniExcel.SaveAs(path, reader,configuration:config);
14571457

14581458
#### 6. Batch Add Image (MiniExcel.AddPicture)
14591459

1460+
Please add pictures before batch generate rows data, or system will load large memory usage when calling AddPicture.
1461+
14601462
```csharp
14611463
var images = new[]
14621464
{

README.zh-CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,8 @@ public class Order
16341634

16351635
#### 6. 批量添加/插入图片 (MiniExcel.AddPicture)
16361636

1637+
请在批量生成行数据之前添加图片,否则在调用 AddPicture 时系统会占用大量内存。
1638+
16371639
```csharp
16381640
var images = new[]
16391641
{

README.zh-Hant.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,8 @@ MiniExcel.SaveAs(path, reader,configuration:config);
13681368

13691369
#### 6. 批量添加/插入圖片 (MiniExcel.AddPicture)
13701370

1371+
請在批量生成行資料之前新增圖片,否則在呼叫 AddPicture 時系統將會佔用大量記憶體。
1372+
13711373
```csharp
13721374
var images = new[]
13731375
{

benchmarks/MiniExcel.Benchmarks/BenchmarkSections/QueryXlsxBenchmark.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ public void NPOI_Query_Test()
113113

114114
for (var i = start; i <= end; i++)
115115
{
116-
var row = worksheet.GetRow(i);
117-
if (row == null)
118-
continue;
119-
for (var j = row.FirstCellNum; j <= row.LastCellNum; j++)
116+
if (worksheet.GetRow(i) is { } row)
120117
{
121-
var cellValue = row.GetCell(j)?.StringCellValue;
118+
for (var j = row.FirstCellNum; j <= row.LastCellNum; j++)
119+
{
120+
var cellValue = row.GetCell(j)?.StringCellValue;
121+
}
122122
}
123123
}
124124
}

docs/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
---
2424

2525

26+
### 1.41.3
27+
- [New] Adding QuoteWhitespaces option to CsvConfiguration for adding double quotes to string containing whitespaces #790 (via @michelebastione )
28+
- [Bug] Fixed bug that made the DynamicExcelColumn property "Ignore" not work when generating using an IDataReader as source #584 (via @michelebastione )
29+
- [Bug] v1.41.2 AddPicture not working #814 (via @shps951023)
30+
- [Bug] v1.41.1 AddPicture image max column and row are 2 cells #815 (via @shps951023)
31+
- [Bug] AddPicture get error same export file and second time. #817 (via @shps951023)
32+
33+
2634
### 1.41.2
2735
- [New] Fixes enum behaviour and adds support for DescriptionAttribute when saving by template (via @michelebastione )
2836
- [Bug] SaveAsByTemplate - Excel Dimension Xml is null #459 (via @michelebastione )

docs/README.zh-CN.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727

2828

2929

30+
### 1.41.3
31+
32+
* 【新增】在 `CsvConfiguration` 中新增 `QuoteWhitespaces` 选项,用于对空白单元的字符串加上双引号 #790(贡献者:@michelebastione
33+
* 【修复】修正使用 `IDataReader` 作为数据源时,`DynamicExcelColumn``Ignore` 属性无效的问题 #584(贡献者:@michelebastione
34+
* 【修复】v1.41.2 中 `AddPicture` 功能无法使用的问题 #814(贡献者:@shps951023
35+
* 【修复】v1.41.1 中 `AddPicture` 插入的图片最大列和行仅限于2个单元格的问题 #815(贡献者:@shps951023
36+
* 【修复】`AddPicture` 在导出文件后再次执行时出现错误的问题 #817(贡献者:@shps951023
37+
38+
39+
40+
3041
### 1.41.2
3142
- [New] 增加 enum behaviour and adds support for DescriptionAttribute when saving by template (via @michelebastione )
3243
- [Bug] SaveAsByTemplate - Excel Dimension Xml is null #459 (via @michelebastione )

docs/README.zh-Hant.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
2525
---
2626

2727

28+
29+
### 1.41.3
30+
31+
* 【新增】在 CsvConfiguration 中新增 `QuoteWhitespaces` 選項,讓包含空白字元的字串自動加上雙引號 #790(由 @michelebastione 提供)
32+
* 【修正】修正當使用 IDataReader 作為資料來源時,DynamicExcelColumn 的 `Ignore` 屬性無效的問題 #584(由 @michelebastione 提供)
33+
* 【修正】v1.41.2 中 `AddPicture` 功能無法使用的問題 #814(由 @shps951023 提供)
34+
* 【修正】v1.41.1 中 `AddPicture` 插入的圖片最大列與欄僅為兩格儲存格的問題 #815(由 @shps951023 提供)
35+
* 【修正】當再次使用相同匯出檔案時,`AddPicture` 發生錯誤的問題 #817(由 @shps951023 提供)
36+
37+
2838
### 1.41.2
2939
- [New] 增加 enum behaviour and adds support for DescriptionAttribute when saving by template (via @michelebastione )
3040
- [Bug] SaveAsByTemplate - Excel Dimension Xml is null #459 (via @michelebastione )

0 commit comments

Comments
 (0)