You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2014/12/30 02:05:41 UTC
svn commit: r1648458 - in /poi: site/src/documentation/content/xdocs/
trunk/src/scratchpad/src/org/apache/poi/hslf/record/
trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/
trunk/test-data/slideshow/
Author: kiwiwings
Date: Tue Dec 30 01:05:41 2014
New Revision: 1648458
URL: http://svn.apache.org/r1648458
Log:
Bug 47261 - SlideShow.removeSlide makes PPT corrupted
Added:
poi/trunk/test-data/slideshow/bug47261.ppt (with props)
Modified:
poi/site/src/documentation/content/xdocs/status.xml
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.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=1648458&r1=1648457&r2=1648458&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/status.xml (original)
+++ poi/site/src/documentation/content/xdocs/status.xml Tue Dec 30 01:05:41 2014
@@ -38,6 +38,7 @@
</devs>
<release version="3.12-beta1" date="2015-??-??">
+ <action dev="PD" type="fix" fixes-bug="47261">SlideShow.removeSlide makes PPT corrupted</action>
<action dev="PD" type="add" fixes-bug="49541">Mapping of symbol characters to unicode equivalent</action>
<action dev="PD" type="add" fixes-bug="54541">Add support for cropped images in Slide.draw()</action>
<action dev="PD" type="add" fixes-bug="57007">Add initial implementations of DMIN and DGET functions</action>
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java?rev=1648458&r1=1648457&r2=1648458&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/Document.java Tue Dec 30 01:05:41 2014
@@ -175,6 +175,10 @@ public final class Document extends Posi
// The new SlideListWithText should go in
// just before the EndDocumentRecord
Record endDoc = _children[_children.length - 1];
+ if(endDoc.getRecordType() == RecordTypes.RoundTripCustomTableStyles12Atom.typeID) {
+ // last record can optionally be a RoundTripCustomTableStyles12Atom
+ endDoc = _children[_children.length - 2];
+ }
if(endDoc.getRecordType() != RecordTypes.EndDocument.typeID) {
throw new IllegalStateException("The last child record of a Document should be EndDocument, but it was " + endDoc);
}
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java?rev=1648458&r1=1648457&r2=1648458&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordTypes.java Tue Dec 30 01:05:41 2014
@@ -67,6 +67,7 @@ public final class RecordTypes {
public static final Type NamedShow = new Type(1041,null);
public static final Type NamedShowSlides = new Type(1042,null);
public static final Type SheetProperties = new Type(1044,null);
+ public static final Type RoundTripCustomTableStyles12Atom = new Type(1064,null);
public static final Type List = new Type(2000,null);
public static final Type FontCollection = new Type(2005,FontCollection.class);
public static final Type BookmarkCollection = new Type(2019,null);
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=1648458&r1=1648457&r2=1648458&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 Tue Dec 30 01:05:41 2014
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEqu
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -594,5 +595,19 @@ public final class TestBugs {
} finally {
inputStream.close();
}
+ }
+
+ @Test
+ public void bug47261() throws Exception {
+ InputStream inputStream = new FileInputStream(_slTests.getFile("bug47261.ppt"));
+ try {
+ SlideShow slideShow = new SlideShow(inputStream);
+ slideShow.removeSlide(0);
+ slideShow.createSlide();
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ slideShow.write(bos);
+ } finally {
+ inputStream.close();
+ }
}
}
Added: poi/trunk/test-data/slideshow/bug47261.ppt
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/bug47261.ppt?rev=1648458&view=auto
==============================================================================
Binary file - no diff available.
Propchange: poi/trunk/test-data/slideshow/bug47261.ppt
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org