beforeCellValue(data);
double val = rkNumber(data, XSSFBCellHeader.length);
String formatString = styles.getNumberFormatString(cellBuffer.getStyleIdx());
- String formattedVal = dataFormatter.formatRawCellContents(val, cellBuffer.getStyleIdx(), formatString);
+ short styleIndex = styles.getNumberFormatIndex(cellBuffer.getStyleIdx());
+ String formattedVal = dataFormatter.formatRawCellContents(val, styleIndex, formatString);
handleCellValue(formattedVal);
}
}
String getNumberFormatString(int idx) {
- if (numberFormats.containsKey(styleIds.get((short)idx))) {
- return numberFormats.get(styleIds.get((short)idx));
+ short numberFormatIdx = getNumberFormatIndex(idx);
+ if (numberFormats.containsKey(numberFormatIdx)) {
+ return numberFormats.get(numberFormatIdx);
}
- return BuiltinFormats.getBuiltinFormat(styleIds.get((short)idx));
+ return BuiltinFormats.getBuiltinFormat(numberFormatIdx);
+ }
+
+ short getNumberFormatIndex(int idx) {
+ return styleIds.get(idx);
}
@Override