avoid nulls in HSSFWorkbook.getAllPictures when EscherBlipRecord is not found
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1025635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
26b76c1087
commit
3fe64d57ae
@ -1594,8 +1594,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
|
|||||||
// TODO: Some kind of structure.
|
// TODO: Some kind of structure.
|
||||||
HSSFPictureData picture = new HSSFPictureData(blip);
|
HSSFPictureData picture = new HSSFPictureData(blip);
|
||||||
pictures.add(picture);
|
pictures.add(picture);
|
||||||
} else {
|
|
||||||
pictures.add(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,4 +71,16 @@ public final class TestHSSFPictureData extends TestCase{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNotNullPictures() throws IOException {
|
||||||
|
|
||||||
|
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("SheetWithDrawing.xls");
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked") // TODO - add getFormat() to interface PictureData and genericise wb.getAllPictures()
|
||||||
|
List<HSSFPictureData> lst = (List<HSSFPictureData>)(List<?>)wb.getAllPictures();
|
||||||
|
for(HSSFPictureData pict : lst){
|
||||||
|
assertNotNull(pict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user