Hello,
I have implemented a possible fix for bug 42844 and wanted to run it by this
list before going ahead. As noted in the bug, HSSFEventFactory doesn't
seem to handle ContinueRecord's though some ContinueRecords do get to this
point in the code. In particular, ObjRecord and DrawingGroupRecord get to
this code and I think they must be handled here. I have modified the else
clause on line 193 in HSSFEventFactory as follows:
else
{
// Sarah Waziruddin - [EMAIL PROTECTED] - 8/15/07
// we have hit a continue record and need to know how
to process it
// this code is written from a combination of code
from 2.x poi versions
// and from how RecordFactory handles continue
records
// get the data from the input stream
short size = in.getLength();
byte[] data = new byte[ size ];
if (data.length > 0)
{
in.read(data);
}
// Drawing records have a very strange continue
behaviour.
//There can actually be OBJ records mixed between the
continues.
if ((rec instanceof ObjRecord) || (rec instanceof
TextObjectRecord))
{
DrawingRecord drawingRecord = new DrawingRecord( );
drawingRecord.setData(new byte[0]);
((DrawingRecord)drawingRecord).processContinueRecord(data);
}
else if (rec instanceof DrawingGroupRecord)
{
((DrawingGroupRecord)rec).processContinueRecord(data);
}
else
{
throw new RecordFormatException("Unhandled Continue
Record");
}
}
As noted, this code borrows from the code in RecordFactory and seems to work
for the purposes of my application. Does anyone have any objections to this
change or suggest another approach to fixing this bug?
Thanks,
Sarah