diff options
author | Yegor Kozlov <yegor@apache.org> | 2010-04-25 12:58:45 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2010-04-25 12:58:45 +0000 |
commit | e38be4e0a7c56df7ae7ccddb0586e3e92d9ccd1d (patch) | |
tree | 6dec2f254ebfd57d2cb3e2b9f8eef87d1163cb7d /src/ooxml/java/org/apache/poi/xssf | |
parent | 5a80808a73f963ad0291726ab325c98b001cb47d (diff) | |
download | poi-e38be4e0a7c56df7ae7ccddb0586e3e92d9ccd1d.tar.gz poi-e38be4e0a7c56df7ae7ccddb0586e3e92d9ccd1d.zip |
Avoid writing malformed CDATA blocks in sharedStrings.xml, see Bugzill 48936
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@937792 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xssf')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java b/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java index ac648c1423..3d402ea436 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java @@ -84,7 +84,7 @@ public class SharedStringsTable extends POIXMLDocumentPart { */ private int uniqueCount; - private SstDocument _sstDoc; + public SstDocument _sstDoc; public SharedStringsTable() { super(); @@ -195,6 +195,10 @@ public class SharedStringsTable extends POIXMLDocumentPart { */ public void writeTo(OutputStream out) throws IOException { XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS); + // the following two lines turn off writing CDATA + // see Bugzilla 48936 + options.setSaveCDataLengthThreshold(1000000); + options.setSaveCDataEntityCountThreshold(-1); //re-create the sst table every time saving a workbook CTSst sst = _sstDoc.getSst(); |