Browse Source

修复xls无法获取sheetList的bug #621

developing
Jiaju Zhuang 5 years ago
parent
commit
3ef6282f21
  1. 2
      src/main/java/com/alibaba/excel/analysis/v03/handlers/BofRecordHandler.java
  2. 2
      src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java

2
src/main/java/com/alibaba/excel/analysis/v03/handlers/BofRecordHandler.java

@ -49,7 +49,6 @@ public class BofRecordHandler extends AbstractXlsRecordHandler {
ReadSheet readSheet = new ReadSheet(sheetIndex, orderedBsrs[sheetIndex].getSheetname()); ReadSheet readSheet = new ReadSheet(sheetIndex, orderedBsrs[sheetIndex].getSheetname());
sheets.add(readSheet); sheets.add(readSheet);
} }
sheetIndex++;
if (context.readSheetHolder() != null) { if (context.readSheetHolder() != null) {
if (sheetIndex == context.readSheetHolder().getSheetNo()) { if (sheetIndex == context.readSheetHolder().getSheetNo()) {
context.readWorkbookHolder().setIgnoreRecord03(Boolean.FALSE); context.readWorkbookHolder().setIgnoreRecord03(Boolean.FALSE);
@ -57,6 +56,7 @@ public class BofRecordHandler extends AbstractXlsRecordHandler {
context.readWorkbookHolder().setIgnoreRecord03(Boolean.TRUE); context.readWorkbookHolder().setIgnoreRecord03(Boolean.TRUE);
} }
} }
sheetIndex++;
} }
} }
} }

2
src/test/java/com/alibaba/easyexcel/test/core/multiplesheets/MultipleSheetsDataTest.java

@ -36,7 +36,7 @@ public class MultipleSheetsDataTest {
} }
@Test @Test
public void t020Read03() { public void t02Read03() {
read(file03); read(file03);
} }

Loading…
Cancel
Save