aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2010-01-24 13:40:58 +0000
committerYegor Kozlov <yegor@apache.org>2010-01-24 13:40:58 +0000
commit5da681c81f2e77eb37bf79febab568147a3ae6b6 (patch)
treef2cebe094c71f5a4c1b8c4933630b7e66b2b731a /src
parent8540edb04a3259cd410b56e9403140d2075e55d8 (diff)
downloadpoi-5da681c81f2e77eb37bf79febab568147a3ae6b6.tar.gz
poi-5da681c81f2e77eb37bf79febab568147a3ae6b6.zip
avoid failures in XLSX2CSV when shared string table is missing, see Bugzilla 48544
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@902566 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/documentation/content/xdocs/status.xml1
-rw-r--r--src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml
index f8ee55fdde..ddd44109b6 100644
--- a/src/documentation/content/xdocs/status.xml
+++ b/src/documentation/content/xdocs/status.xml
@@ -34,6 +34,7 @@
<changes>
<release version="3.7-SNAPSHOT" date="2010-??-??">
+ <action dev="POI-DEVELOPERS" type="fix">48544 - avoid failures in XLSX2CSV when shared string table is missing</action>
<action dev="POI-DEVELOPERS" type="fix">48571 - properly close all IO streams created in OPCPackage</action>
<action dev="POI-DEVELOPERS" type="fix">48572 - always copy all declared inner classes and interfaces when generating poi-ooxml-schemas</action>
<action dev="POI-DEVELOPERS" type="add">Low Level record support for the ExtRst (phonetic text) part of Unicode Strings. No usermodel access to it as yet though.</action>
diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
index 8a77e599df..93dae5dcee 100644
--- a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
+++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java
@@ -151,8 +151,12 @@ public class XLSX2CSV {
throws IOException, SAXException, ParserConfigurationException {
ArrayList<PackagePart> parts =
pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType());
- PackagePart sstPart = parts.get(0);
- readFrom(sstPart.getInputStream());
+
+ // Some workbooks have no shared strings table.
+ if (parts.size() > 0) {
+ PackagePart sstPart = parts.get(0);
+ readFrom(sstPart.getInputStream());
+ }
}
/**