From 33b7f25fd454b82efd00adb16e4cc9d115f3933f Mon Sep 17 00:00:00 2001 From: walon Date: Mon, 5 Dec 2022 18:04:24 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8Dexcel=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=AD=E4=BB=85=E9=9D=9E=E6=9C=89=E6=95=88=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=88=97=E9=9D=9E=E7=A9=BA=E7=9A=84=E8=A1=8C=E8=A2=AB?= =?UTF-8?q?=E5=88=A4=E5=AE=9A=E4=B8=BA=E9=9D=9E=E7=A9=BA=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=A7=A3=E6=9E=90=E6=95=B0=E6=8D=AE=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/DataSources/Excel/RowColumnSheet.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Luban.Job.Cfg/Source/DataSources/Excel/RowColumnSheet.cs b/src/Luban.Job.Cfg/Source/DataSources/Excel/RowColumnSheet.cs index 3564398..a4d63d0 100644 --- a/src/Luban.Job.Cfg/Source/DataSources/Excel/RowColumnSheet.cs +++ b/src/Luban.Job.Cfg/Source/DataSources/Excel/RowColumnSheet.cs @@ -42,7 +42,7 @@ namespace Luban.Job.Cfg.DataSources.Excel { foreach (var row in cells) { - if (IsBlankRow(row, title.FromIndex, title.ToIndex)) + if (IsBlankRow(row, title)) { continue; } @@ -188,6 +188,15 @@ namespace Luban.Job.Cfg.DataSources.Excel return Rows; } + public static bool IsBlankRow(List row, Title title) + { + if (title.SubTitleList.Count == 0) + { + return IsBlankRow(row, title.FromIndex, title.ToIndex); + } + return title.SubTitleList.All(t => IsBlankRow(row, t)); + } + public static bool IsBlankRow(List row, int fromIndex, int toIndex) { for (int i = Math.Max(1, fromIndex), n = Math.Min(toIndex, row.Count - 1); i <= n; i++)