Bug 60715

Summary: Blank layout was not found
Product: POI Reporter: Johan Walter <jw>
Component: XSLFAssignee: POI Developers List <dev>
Severity: major    
Priority: P2    
Version: 3.15-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: A simple PowerPoint file

Description Johan Walter 2017-02-09 09:43:46 UTC
Created attachment 34740 [details]
A simple PowerPoint file

The attached file was created using Microsoft PowerPoint 2016.

When trying to add a slide using:

    public void testRead() throws IOException {
        File file = new File("test.pptx");
        FileInputStream fileInputStream = new FileInputStream(file);
        XMLSlideShow xmlSlideShow = new XMLSlideShow(fileInputStream);
        XSLFSlide slide = xmlSlideShow.createSlide();

I get this error message:

java.lang.IllegalArgumentException: Blank layout was not found
	at org.apache.poi.xslf.usermodel.XMLSlideShow.createSlide(XMLSlideShow.java:240)
Comment 1 Andreas Beeker 2017-02-11 21:52:55 UTC
Usually the slidelayouts have a corresponding type. I haven't found a way to distinguish the layout, therefore I simply used the first slidelayout in the slidemaster.

Applied via r1782635