aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xssf
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2010-04-25 12:58:45 +0000
committerYegor Kozlov <yegor@apache.org>2010-04-25 12:58:45 +0000
commite38be4e0a7c56df7ae7ccddb0586e3e92d9ccd1d (patch)
tree6dec2f254ebfd57d2cb3e2b9f8eef87d1163cb7d /src/ooxml/java/org/apache/poi/xssf
parent5a80808a73f963ad0291726ab325c98b001cb47d (diff)
downloadpoi-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.java6
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();