diff --git a/CHANGELOG.md b/CHANGELOG.md index 35a8e7bf0..9f0ef64dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------------------------------------- -# 5.7.17 (2021-12-01) +# 5.7.17 (2021-12-05) ### 🐣新特性 * 【core 】 增加AsyncUtil(pr#457@Gitee) @@ -41,6 +41,8 @@ * 【poi 】 修复SoapClient参数未使用问题 * 【core 】 修复HashUtil.cityHash128参数未使用问题 * 【core 】 修复DateUtil.formatChineseDate显示问题(issue#I4KK5F@Gitee) +* 【poi 】 修复CellUtil.setCellValuestyle空导致值无法写入问题(issue#1995@Github) +* 【poi 】 修复CellUtil.setComment参数设置错误问题 ------------------------------------------------------------------------------------------------------------- diff --git a/hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java b/hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java index 2d3883ddb..2a60abe11 100644 --- a/hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java +++ b/hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java @@ -162,9 +162,9 @@ public class CellUtil { */ public static void setCellValue(Cell cell, Object value, CellStyle style) { setCellValue(cell, (CellSetter) cell1 -> { + setCellValue(cell, value); if (null != style) { cell1.setCellStyle(style); - setCellValue(cell, value); } }); } @@ -175,7 +175,7 @@ public class CellUtil { * 当为头部样式时默认赋值头部样式,但是头部中如果有数字、日期等类型,将按照数字、日期样式设置 * * @param cell 单元格 - * @param value 值 + * @param value 值或{@link CellSetter} * @since 5.6.4 */ public static void setCellValue(Cell cell, Object value) { @@ -402,7 +402,7 @@ public class CellUtil { } Comment comment = drawing.createCellComment(anchor); comment.setString(factory.createRichTextString(commentText)); - comment.setAuthor(StrUtil.nullToEmpty(commentText)); + comment.setAuthor(StrUtil.nullToEmpty(commentAuthor)); cell.setCellComment(comment); }