// 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);
}
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);
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;
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();
+ }
+ }
}