}
public static ShapeType forId(int id, boolean isOoxmlId){
+ // exemption for #60294
+ if (!isOoxmlId && id == 0x0FFF) {
+ return NOT_PRIMITIVE;
+ }
+
for(ShapeType t : values()){
if((isOoxmlId && t.ooxmlId == id) ||
(!isOoxmlId && t.nativeId == id)) return t;
import org.apache.poi.sl.usermodel.PaintStyle.SolidPaint;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.poi.sl.usermodel.Placeholder;
+import org.apache.poi.sl.usermodel.ShapeType;
import org.apache.poi.sl.usermodel.Slide;
import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.sl.usermodel.SlideShowFactory;
}
return null;
}
+
+ /**
+ * Bug 60294: Add "unknown" ShapeType for 4095
+ */
+ @Test
+ public void bug60294() throws IOException {
+ HSLFSlideShow ppt = open("60294.ppt");
+ List<HSLFShape> shList = ppt.getSlides().get(0).getShapes();
+ assertEquals(ShapeType.NOT_PRIMITIVE, ((HSLFAutoShape)shList.get(2)).getShapeType());
+ ppt.close();
+ }
}