From 49b64dd3df307aea106be7570ad1b2cda556078b Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 11 May 2022 09:56:20 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86`xls`?= =?UTF-8?q?=E5=AE=B9=E9=94=99=20[Issue=20#2236](https://github.com/alibaba?= =?UTF-8?q?/easyexcel/issues/2236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/analysis/v03/handlers/DummyRecordHandler.java | 5 ++++- update.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/DummyRecordHandler.java b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/DummyRecordHandler.java index 8ecc33a4e..b5c853c57 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/DummyRecordHandler.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/analysis/v03/handlers/DummyRecordHandler.java @@ -34,7 +34,10 @@ public void processRecord(XlsReadContext xlsReadContext, Record record) { xlsReadSheetHolder.setTempRowType(RowTypeEnum.EMPTY); } else if (record instanceof MissingCellDummyRecord) { MissingCellDummyRecord mcdr = (MissingCellDummyRecord)record; - xlsReadSheetHolder.getCellMap().put(mcdr.getColumn(), + // https://github.com/alibaba/easyexcel/issues/2236 + // Some abnormal XLS, in the case of data already exist, or there will be a "MissingCellDummyRecord" + // records, so if the existing data, empty data is ignored + xlsReadSheetHolder.getCellMap().putIfAbsent(mcdr.getColumn(), ReadCellData.newEmptyInstance(mcdr.getRow(), mcdr.getColumn())); } } diff --git a/update.md b/update.md index 6e8b1f45b..2c11e6c09 100644 --- a/update.md +++ b/update.md @@ -8,6 +8,7 @@ * 修复03版本无法读取到公式格式的bug [Issue #2444](https://github.com/alibaba/easyexcel/issues/2444) * 提高类型转换兼容性 [Issue #2443](https://github.com/alibaba/easyexcel/issues/2443) * 捕获`setFeature`异常不影响主流程 [Issue #2054](https://github.com/alibaba/easyexcel/issues/2054) +* 增加部分`xls`容错 [Issue #2236](https://github.com/alibaba/easyexcel/issues/2236) # 3.0.5