From: Nick Burch Date: Tue, 5 Jul 2011 13:42:08 +0000 (+0000) Subject: Fix bug #51474 - SXSSF handling for null strings X-Git-Tag: REL_3_8_BETA4~312 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6ad2983a79f6ea0510d8afd7ead069543e68e9e1;p=poi.git Fix bug #51474 - SXSSF handling for null strings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143059 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index e83b0f51d9..7f0d31a09a 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 51474 - SXSSF handling for null strings 48294 - Fixed HSSFWorkbook.setSheetOrder() to respect inter-sheet references 51448 - Avoid exception when evaluating workbooks with more than 256 sheets 51458 - Correct BitField wrapping when setting large values diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index 96af6932b0..bb5d8ac810 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -22,7 +22,6 @@ import java.util.Iterator; import java.util.TreeMap; import java.util.Map; -import org.apache.poi.hpsf.IllegalPropertySetDataException; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellReference; @@ -1402,6 +1401,10 @@ public class SXSSFSheet implements Sheet, Cloneable //Taken from jdk1.3/src/javax/swing/text/html/HTMLWriter.java protected void outputQuotedString(String s) throws IOException { + if(s == null || s.length() == 0) { + return; + } + char[] chars=s.toCharArray(); int last = 0; int length=s.length();