Browse Source

Merge branch 'bugfix' into developing

# Conflicts:
#	pom.xml
#	src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java
pull/2077/head
Jiaju Zhuang 3 years ago
parent
commit
086721a60f
  1. 11
      src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java
  2. 9
      src/test/java/com/alibaba/easyexcel/test/temp/WriteV33Test.java
  3. 2
      src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java

11
src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java

@ -5,6 +5,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
@ -231,10 +232,12 @@ public class XlsxSaxAnalyser implements ExcelReadExecutor {
if (commentsTable == null) { if (commentsTable == null) {
return; return;
} }
Map<CellAddress, XSSFComment> cellComments = commentsTable.getCellComments(); Iterator<CellAddress> cellAddresses = commentsTable.getCellAddresses();
for (XSSFComment xssfComment : cellComments.values()) { for (Iterator<CellAddress> it = cellAddresses; it.hasNext(); ) {
CellExtra cellExtra = new CellExtra(CellExtraTypeEnum.COMMENT, xssfComment.getString().toString(), CellAddress cellAddress = it.next();
xssfComment.getRow(), xssfComment.getColumn()); XSSFComment cellComment = commentsTable.findCellComment(cellAddress);
CellExtra cellExtra = new CellExtra(CellExtraTypeEnum.COMMENT, cellComment.getString().toString(),
cellAddress.getRow(), cellAddress.getColumn());
xlsxReadContext.readSheetHolder().setCellExtra(cellExtra); xlsxReadContext.readSheetHolder().setCellExtra(cellExtra);
xlsxReadContext.analysisEventProcessor().extra(xlsxReadContext); xlsxReadContext.analysisEventProcessor().extra(xlsxReadContext);
} }

9
src/test/java/com/alibaba/easyexcel/test/temp/WriteV33Test.java

@ -1,13 +1,8 @@
package com.alibaba.easyexcel.test.temp; package com.alibaba.easyexcel.test.temp;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.poi.hssf.util.CellReference;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -19,10 +14,6 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy; import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.fastjson.JSON;
/** /**
* 临时测试 * 临时测试

2
src/test/java/com/alibaba/easyexcel/test/temp/dataformat/DataFormatter1.java

@ -973,7 +973,7 @@ public class DataFormatter1 implements Observer {
if (evaluator == null) { if (evaluator == null) {
return cell.getCellFormula(); return cell.getCellFormula();
} }
cellType = evaluator.evaluateFormulaCellEnum(cell); cellType = evaluator.evaluateFormulaCell(cell);
} }
switch (cellType) { switch (cellType) {
case NUMERIC: case NUMERIC:

Loading…
Cancel
Save