You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ta...@apache.org on 2017/06/20 12:59:33 UTC
svn commit: r1799345 -
/poi/trunk/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java
Author: tallison
Date: Tue Jun 20 12:59:33 2017
New Revision: 1799345
URL: http://svn.apache.org/viewvc?rev=1799345&view=rev
Log:
bug 61053 -- not a fix, but this aligns XSSFBSheetHandler's behavior with streaming and non-streaming extractors for xlsx
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java
Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java?rev=1799345&r1=1799344&r2=1799345&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java Tue Jun 20 12:59:33 2017
@@ -21,6 +21,7 @@ package org.apache.poi.xssf.binary;
import java.io.InputStream;
import java.util.Queue;
+import org.apache.poi.ss.usermodel.BuiltinFormats;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.util.CellAddress;
import org.apache.poi.util.Internal;
@@ -193,6 +194,14 @@ public class XSSFBSheetHandler extends X
private String formatVal(double val, int styleIdx) {
String formatString = styles.getNumberFormatString(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);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org