Skip to content

Commit 788574b

Browse files
authored
Merge pull request #409 from liaochong/feature/4.4.1
fix bug
2 parents 3883751 + 081958b commit 788574b

2 files changed

Lines changed: 1 addition & 21 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>com.github.liaochong</groupId>
1313
<artifactId>myexcel</artifactId>
14-
<version>4.4.0</version>
14+
<version>4.4.1</version>
1515
<packaging>jar</packaging>
1616

1717
<name>myexcel</name>

src/main/java/com/github/liaochong/myexcel/core/AbstractExcelFactory.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ public abstract class AbstractExcelFactory implements ExcelFactory {
110110
* 是否为hssf
111111
*/
112112
protected boolean isHssf;
113-
/**
114-
* 每行的单元格最大高度map
115-
*/
116-
private Map<Integer, Short> maxTdHeightMap = new HashMap<>();
117113
/**
118114
* 是否使用默认样式
119115
*/
@@ -254,14 +250,6 @@ protected void createRow(Tr tr, Sheet sheet) {
254250
}
255251
if (tr.height > 0) {
256252
row.setHeightInPoints(tr.height);
257-
} else {
258-
// 设置行高,最小12
259-
if (maxTdHeightMap.get(row.getRowNum()) == null) {
260-
row.setHeightInPoints(row.getHeightInPoints() + 5);
261-
} else {
262-
row.setHeightInPoints((short) (maxTdHeightMap.get(row.getRowNum()) + 5));
263-
maxTdHeightMap.remove(row.getRowNum());
264-
}
265253
}
266254
stagingTds.stream().filter(blankTd -> Objects.equals(blankTd.row, tr.index)).forEach(td -> {
267255
if (tr.tdList == Collections.EMPTY_LIST) {
@@ -631,13 +619,6 @@ private void setCellStyle(Row row, Cell cell, Td td) {
631619
if (td.style.isEmpty() && !applyDefaultStyle) {
632620
return;
633621
}
634-
String fs = td.style.get("font-size");
635-
if (fs != null) {
636-
short fontSize = (short) TdUtil.getValue(fs);
637-
if (fontSize > maxTdHeightMap.getOrDefault(row.getRowNum(), FontStyle.DEFAULT_FONT_SIZE)) {
638-
maxTdHeightMap.put(row.getRowNum(), fontSize);
639-
}
640-
}
641622
if (applyDefaultStyle) {
642623
if (td.th) {
643624
DEFAULT_TH_STYLE.forEach((k, v) -> td.style.putIfAbsent(k, v));
@@ -806,7 +787,6 @@ protected void setColWidth(Map<Integer, Integer> colMaxWidthMap, Sheet sheet, in
806787
protected void clearCache() {
807788
cellStyleMap = new HashMap<>();
808789
fontMap = new HashMap<>();
809-
maxTdHeightMap = new HashMap<>();
810790
format = null;
811791
createHelper = null;
812792
imageMapping = null;

0 commit comments

Comments
 (0)