|
|
|
@ -1,8 +1,5 @@
|
|
|
|
|
package com.alibaba.excel.analysis.v07.handlers; |
|
|
|
|
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle; |
|
|
|
|
import org.xml.sax.Attributes; |
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.constant.BuiltinFormats; |
|
|
|
|
import com.alibaba.excel.constant.ExcelXmlConstants; |
|
|
|
|
import com.alibaba.excel.context.xlsx.XlsxReadContext; |
|
|
|
@ -12,6 +9,10 @@ import com.alibaba.excel.read.metadata.holder.xlsx.XlsxReadSheetHolder;
|
|
|
|
|
import com.alibaba.excel.util.PositionUtils; |
|
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
|
|
|
|
|
|
import org.apache.poi.xssf.model.StylesTable; |
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle; |
|
|
|
|
import org.xml.sax.Attributes; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Cell Handler |
|
|
|
|
* |
|
|
|
@ -46,8 +47,11 @@ public class CellTagHandler extends AbstractXlsxTagHandler {
|
|
|
|
|
} else { |
|
|
|
|
dateFormatIndexInteger = Integer.parseInt(dateFormatIndex); |
|
|
|
|
} |
|
|
|
|
XSSFCellStyle xssfCellStyle = |
|
|
|
|
xlsxReadContext.xlsxReadWorkbookHolder().getStylesTable().getStyleAt(dateFormatIndexInteger); |
|
|
|
|
StylesTable stylesTable = xlsxReadContext.xlsxReadWorkbookHolder().getStylesTable(); |
|
|
|
|
if (stylesTable == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
XSSFCellStyle xssfCellStyle = stylesTable.getStyleAt(dateFormatIndexInteger); |
|
|
|
|
int dataFormat = xssfCellStyle.getDataFormat(); |
|
|
|
|
xlsxReadSheetHolder.getTempCellData().setDataFormat(dataFormat); |
|
|
|
|
xlsxReadSheetHolder.getTempCellData().setDataFormatString(BuiltinFormats.getBuiltinFormat(dataFormat, |
|
|
|
|