mirror of https://github.com/apache/poi.git
Bug 60906 -- fix style index
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1788282 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
398a7197bd
commit
e40c26b56d
|
@ -192,7 +192,8 @@ public class XSSFBSheetHandler extends XSSFBParser {
|
||||||
beforeCellValue(data);
|
beforeCellValue(data);
|
||||||
double val = rkNumber(data, XSSFBCellHeader.length);
|
double val = rkNumber(data, XSSFBCellHeader.length);
|
||||||
String formatString = styles.getNumberFormatString(cellBuffer.getStyleIdx());
|
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);
|
handleCellValue(formattedVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,16 @@ public class XSSFBStylesTable extends XSSFBParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
String getNumberFormatString(int idx) {
|
String getNumberFormatString(int idx) {
|
||||||
if (numberFormats.containsKey(styleIds.get((short)idx))) {
|
short numberFormatIdx = getNumberFormatIndex(idx);
|
||||||
return numberFormats.get(styleIds.get((short)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
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue