]> source.dussan.org Git - poi.git/commitdiff
avoid failures in XLSX2CSV when shared string table is missing, see Bugzilla 48544
authorYegor Kozlov <yegor@apache.org>
Sun, 24 Jan 2010 13:40:58 +0000 (13:40 +0000)
committerYegor Kozlov <yegor@apache.org>
Sun, 24 Jan 2010 13:40:58 +0000 (13:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@902566 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java

index f8ee55fdde9fa2a8a597e7f6c2aafacb73fd16ec..ddd44109b67c8ad4933037ba2f71003de3390e46 100644 (file)
@@ -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>
index 8a77e599dfa69794b7238fcb21f59c8b736e8967..93dae5dcee9eb035cb0adc6ab4c2caae500ddab4 100644 (file)
@@ -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());
+            }
         }
 
         /**