You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by ye...@apache.org on 2007/03/21 15:04:33 UTC

svn commit: r520893 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/Record.java testcases/org/apache/poi/hslf/data/41384.ppt testcases/org/apache/poi/hslf/usermodel/TestBugs.java

Author: yegor
Date: Wed Mar 21 07:04:32 2007
New Revision: 520893

URL: http://svn.apache.org/viewvc?view=rev&rev=520893
Log:
fixed bug 41384: Array index wrong in record creation

Added:
    jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/41384.ppt   (with props)
    jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
Modified:
    jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java

Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java?view=diff&rev=520893&r1=520892&r2=520893
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java (original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Record.java Wed Mar 21 07:04:32 2007
@@ -129,7 +129,7 @@
 				// Record was horribly corrupt
 			}
 			pos += 8;
-			pos += rlen;
+			pos += rleni;
 		}
 
 		// Turn the vector into an array, and return

Added: jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/41384.ppt
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/41384.ppt?view=auto&rev=520893
==============================================================================
Binary file - no diff available.

Propchange: jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/41384.ppt
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java?view=auto&rev=520893
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java (added)
+++ jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java Wed Mar 21 07:04:32 2007
@@ -0,0 +1,53 @@
+
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+package org.apache.poi.hslf.usermodel;
+
+import junit.framework.TestCase;
+import org.apache.poi.hslf.HSLFSlideShow;
+import org.apache.poi.hslf.model.Picture;
+
+import java.io.*;
+
+/**
+ * Testcases for bugs entered in bugzilla
+ * the Test name contains the bugzilla bug id
+ *
+ * @author Yegor Kozlov
+ */
+public class TestBugs extends TestCase {
+    protected String cwd = System.getProperty("HSLF.testdata.path");
+
+    /**
+     * Bug 41384: Array index wrong in record creation
+     */
+    public void test41384() throws Exception {
+        FileInputStream is = new FileInputStream(new File(cwd, "41384.ppt"));
+        HSLFSlideShow hslf = new HSLFSlideShow(is);
+        is.close();
+
+        SlideShow ppt = new SlideShow(hslf);
+        assertTrue("No Exceptions while reading file", true);
+
+        assertEquals(1, ppt.getSlides().length);
+
+        PictureData[] pict = ppt.getPictureData();
+        assertEquals(2, pict.length);
+        assertEquals(Picture.JPEG, pict[0].getType());
+        assertEquals(Picture.JPEG, pict[1].getType());
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/