Bug 48544 - Example code XLSX2CSV fails when shared string table is missing
Summary: Example code XLSX2CSV fails when shared string table is missing
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.6-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-14 07:57 UTC by Chris Lott
Modified: 2010-01-24 05:41 UTC (History)
0 users



Attachments
Patch to ReadOnlySharedStringTable class constructor (650 bytes, text/plain)
2010-01-14 07:57 UTC, Chris Lott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lott 2010-01-14 07:57:40 UTC
Created attachment 24844 [details]
Patch to ReadOnlySharedStringTable class constructor

I contributed code as Bug 47757 that converts an XLSX workbook to CSV format.  The class is here:

http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java

I recently found a bug in an embedded class, ReadonlySharedStringsTable, that is triggered by a workbook that contains only numbers and therefore has no shared strings table.  I've attached a small patch that revises the constructor to check that the ArrayList of package parts is not empty before grabbing the first item.  Hope this helps.
Comment 1 Yegor Kozlov 2010-01-24 05:41:16 UTC
Thanks for the fix, applied in r902566

Yegor