Bug 60715 - Blank layout was not found
Summary: Blank layout was not found
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.15-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-09 09:43 UTC by Johan Walter
Modified: 2017-02-11 21:52 UTC (History)
0 users



Attachments
A simple PowerPoint file (72.55 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2017-02-09 09:43 UTC, Johan Walter
Details

Note You need to log in before you can comment on or make changes to this bug.
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:

    @Test
    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