Author: kiwiwings Date: Sat Oct 22 19:34:47 2016 New Revision: 1766227 URL: http://svn.apache.org/viewvc?rev=1766227&view=rev Log: Bug 60294 - Add "unknown" ShapeType for 4095
Added: poi/trunk/test-data/slideshow/60294.ppt (with props) Modified: poi/site/src/documentation/content/xdocs/status.xml poi/trunk/src/java/org/apache/poi/sl/usermodel/ShapeType.java poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java Modified: poi/site/src/documentation/content/xdocs/status.xml URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/status.xml?rev=1766227&r1=1766226&r2=1766227&view=diff ============================================================================== --- poi/site/src/documentation/content/xdocs/status.xml (original) +++ poi/site/src/documentation/content/xdocs/status.xml Sat Oct 22 19:34:47 2016 @@ -60,6 +60,7 @@ <summary-item>Document each major change in the release notes in a summary item</summary-item> </summary --> <actions> + <action dev="PD" type="fix" fixes-bug="60294" module="HSLF">Add "unknown" ShapeType for 4095</action> <action dev="PD" type="fix" fixes-bug="60289" module="XSSF">Fix handling of rich-text unicode escapes with lowercase hex-chars</action> <action dev="PD" type="fix" fixes-bug="60288" module="OOXML">reduce speed to lookup document relationships</action> <action dev="PD" type="add" fixes-bug="60029" module="POI">Fix problem with Days360 method for the month of february</action> Modified: poi/trunk/src/java/org/apache/poi/sl/usermodel/ShapeType.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/usermodel/ShapeType.java?rev=1766227&r1=1766226&r2=1766227&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/sl/usermodel/ShapeType.java (original) +++ poi/trunk/src/java/org/apache/poi/sl/usermodel/ShapeType.java Sat Oct 22 19:34:47 2016 @@ -307,6 +307,11 @@ public enum ShapeType { } 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; Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java?rev=1766227&r1=1766226&r2=1766227&view=diff ============================================================================== --- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java (original) +++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java Sat Oct 22 19:34:47 2016 @@ -75,6 +75,7 @@ import org.apache.poi.sl.usermodel.Paint 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; @@ -1008,4 +1009,15 @@ public final class TestBugs { } 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(); + } } Added: poi/trunk/test-data/slideshow/60294.ppt URL: http://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/60294.ppt?rev=1766227&view=auto ============================================================================== Binary file - no diff available. Propchange: poi/trunk/test-data/slideshow/60294.ppt ------------------------------------------------------------------------------ svn:mime-type = application/vnd.ms-powerpoint --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org