Tweak constructor to be more open, and fix some generics warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@995429 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2010-09-09 13:57:05 +00:00
parent 63beafeb10
commit 60ff5c056d
2 changed files with 14 additions and 22 deletions

View File

@ -50,7 +50,7 @@ public class HSSFPictureData implements PictureData
*
* @param blip the underlying blip record containing the bitmap data.
*/
HSSFPictureData( EscherBlipRecord blip )
public HSSFPictureData( EscherBlipRecord blip )
{
this.blip = blip;
}

View File

@ -1581,29 +1581,21 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
* @param escherRecords the escher records.
* @param pictures the list to populate with the pictures.
*/
private void searchForPictures(List escherRecords, List<HSSFPictureData> pictures)
private void searchForPictures(List<EscherRecord> escherRecords, List<HSSFPictureData> pictures)
{
Iterator recordIter = escherRecords.iterator();
while (recordIter.hasNext())
{
Object obj = recordIter.next();
if (obj instanceof EscherRecord)
{
EscherRecord escherRecord = (EscherRecord) obj;
for(EscherRecord escherRecord : escherRecords) {
if (escherRecord instanceof EscherBSERecord)
{
EscherBlipRecord blip = ((EscherBSERecord) escherRecord).getBlipRecord();
if (blip != null)
{
// TODO: Some kind of structure.
pictures.add(new HSSFPictureData(blip));
}
}
if (escherRecord instanceof EscherBSERecord)
{
EscherBlipRecord blip = ((EscherBSERecord) escherRecord).getBlipRecord();
if (blip != null)
{
// TODO: Some kind of structure.
pictures.add(new HSSFPictureData(blip));
}
}
// Recursive call.
searchForPictures(escherRecord.getChildRecords(), pictures);
}
// Recursive call.
searchForPictures(escherRecord.getChildRecords(), pictures);
}
}