I am using the poi-2.5-final library and I am having the problem
described in Bug 19053 located here:
http://issues.apache.org/bugzilla/show_bug.cgi?id=19053
The problem seems to occur because the
org.apache.poi.hssf.record.LabelRecord does not implement the Comparable
interface. The fix that I have provided in the patch, from the 2.5
source release below, converts all LabelRecord objects to LabalSSTRecord
objects _before_ they are added to the TreeMap.
Has this problem already been fixed after the 2.5 release? If not, can
this patch or a similar solution be applied?
Thanks,
John Thorhauer
--
********************************
** John Thorhauer
** Sr. Java Developer
** Phoenix Color Corp.
** [EMAIL PROTECTED]
********************************
src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
173a174,175
> Sheet.convertLabelRecords(workbook, records);
>
./src/java/org/apache/poi/hssf/model/Sheet.java
110c110
< * a record offset (should be the location of the sheets BOF record). A Sheet
---
> * a ecord offset (should be the location of the sheets BOF record). A Sheet
134c134
<
---
>
533a534,560
>
> public static void convertLabelRecords(Workbook wb, List recs)
> {
> log.log(POILogger.DEBUG, "convertLabelRecords called");
>
> for (int k = 0; k < recs.size(); k++)
> {
> Record rec = ( Record ) recs.get(k);
>
> if (rec.getSid() == LabelRecord.sid)
> {
> LabelRecord oldrec = ( LabelRecord ) rec;
> recs.remove(k);
> LabelSSTRecord newrec = new LabelSSTRecord();
> int stringid = wb.addSSTString(oldrec.getValue());
>
> newrec.setRow(oldrec.getRow());
> newrec.setColumn(oldrec.getColumn());
> newrec.setXFIndex(oldrec.getXFIndex());
> newrec.setSSTIndex(stringid);
> recs.add(k, newrec);
> }
> }
>
> log.log(POILogger.DEBUG, "convertLabelRecords exit");
> }
>
554a582
>
562d589
<
572c599,600
< records.add(k, newrec);
---
> records.add(k, newrec);
>
578a607
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]