Browse Source

bug 61053 -- not a fix, but this aligns XSSFBSheetHandler's behavior with streaming and non-streaming extractors for xlsx

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799345 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_17_BETA1
Tim Allison 7 years ago
parent
commit
f758bbb915

+ 9
- 0
src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java View File

import java.io.InputStream; import java.io.InputStream;
import java.util.Queue; import java.util.Queue;


import org.apache.poi.ss.usermodel.BuiltinFormats;
import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.util.CellAddress; import org.apache.poi.ss.util.CellAddress;
import org.apache.poi.util.Internal; import org.apache.poi.util.Internal;
private String formatVal(double val, int styleIdx) { private String formatVal(double val, int styleIdx) {
String formatString = styles.getNumberFormatString(styleIdx); String formatString = styles.getNumberFormatString(styleIdx);
short styleIndex = styles.getNumberFormatIndex(styleIdx); short styleIndex = styles.getNumberFormatIndex(styleIdx);
//for now, if formatString is null, silently punt
//and use "General". Not the best behavior,
//but we're doing it now in the streaming and non-streaming
//extractors for xlsx. See BUG-61053
if (formatString == null) {
formatString = BuiltinFormats.getBuiltinFormat(0);
styleIndex = 0;
}
return dataFormatter.formatRawCellContents(val, styleIndex, formatString); return dataFormatter.formatRawCellContents(val, styleIndex, formatString);
} }



Loading…
Cancel
Save