Browse Source

* 修复复杂表头不是`index=0`开始 合并异常的bug #1322

developing
Jiaju Zhuang 4 years ago
parent
commit
0de3e57d6b
  1. 6
      src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java
  2. 1
      update.md

6
src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java

@ -66,7 +66,8 @@ public class ExcelWriteHeadProperty extends ExcelHeadProperty {
Integer index = entry.getKey();
ExcelContentProperty excelContentPropertyData = entry.getValue();
if (excelContentPropertyData == null) {
throw new IllegalArgumentException("Passing in the class and list the head, the two must be the same size.");
throw new IllegalArgumentException(
"Passing in the class and list the head, the two must be the same size.");
}
Field field = excelContentPropertyData.getField();
Head headData = getHeadMap().get(index);
@ -180,7 +181,8 @@ public class ExcelWriteHeadProperty extends ExcelHeadProperty {
if (j == lastRow && i == lastCol) {
continue;
}
cellRangeList.add(new CellRange(j, lastRow, i, lastCol));
cellRangeList
.add(new CellRange(j, lastRow, head.getColumnIndex(), headList.get(lastCol).getColumnIndex()));
}
}
return cellRangeList;

1
update.md

@ -6,6 +6,7 @@
* 修复多个`sheet`不按照顺序写入 会乱序的bug [Issue #1332](https://github.com/alibaba/easyexcel/issues/1332)
* 修改head是List时,内容单元格的样式不生效 [Issue #1339](https://github.com/alibaba/easyexcel/issues/1339)
* 新增写入`class`和`list`同时传入 `field`数量不一致报错 [Issue #1333](https://github.com/alibaba/easyexcel/issues/1333)
* 修复复杂表头不是`index=0`开始 合并异常的bug [Issue #1322](https://github.com/alibaba/easyexcel/issues/1322)
# 2.2.3

Loading…
Cancel
Save