bugfix: ClassCastException it PicturesTable.getAllPictures():

UnknownEscherRecord cannot be cast to EscherBlipRecord


git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@931111 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maxim Valyanskiy 2010-04-06 12:12:03 +00:00
parent c8d66033f0
commit e53e3a376e
1 changed files with 7 additions and 3 deletions

View File

@ -168,11 +168,15 @@ public final class PicturesTable
{
// Blip stored in delay stream, which in a word doc, is the main stream
EscherRecordFactory recordFactory = new DefaultEscherRecordFactory();
blip = (EscherBlipRecord) recordFactory.createRecord(_mainStream, bse.getOffset());
blip.fillFields(_mainStream, bse.getOffset(), recordFactory);
EscherRecord record = recordFactory.createRecord(_mainStream, bse.getOffset());
if (record instanceof EscherBlipRecord) {
record.fillFields(_mainStream, bse.getOffset(), recordFactory);
blip = (EscherBlipRecord) record;
pictures.add(new Picture(blip.getPicturedata()));
}
}
}
// Recursive call.
searchForPictures(escherRecord.getChildRecords(), pictures);