Bug 51085 - Creation of slidemaster background results in a red cross
Summary: Creation of slidemaster background results in a red cross
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.7-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-19 08:00 UTC by tobias.meissner
Modified: 2016-01-16 22:56 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tobias.meissner 2011-04-19 08:00:19 UTC
When using the following lines of code (worked in version 3.0.2 ), the powerpoint slide is created, but instead of a proper background a red cross appears.

The used layoutfile is an existing PNG file, which definitely worked in older versions.

            SlideShow ppt = new SlideShow()
            SlideMaster master = ppt.getSlidesMasters()[0];
            Fill fill = master.getBackground().getFill();
            int idx = ppt.addPicture(layoutFile, Picture.PNG);
            fill.setFillType(Fill.FILL_PICTURE);
            fill.setPictureData(idx);
...
Comment 1 Andreas Beeker 2016-01-16 18:07:09 UTC
This is not happening anymore - if unsure, please add your <layoutFile>.png.

This was my testcode:

@Test
public void bug51085() throws IOException {
    File sample = HSLFTestDataSamples.getSampleFile("tomcat.png");
    HSLFSlideShow ppt = new HSLFSlideShow();
    HSLFSlideMaster sm = ppt.getSlideMasters().get(0);
    HSLFFill fill = sm.getBackground().getFill();
    HSLFPictureData pd = ppt.addPicture(sample, PictureData.PictureType.PNG);
    fill.setFillType(HSLFFill.FILL_PICTURE);
    fill.setPictureData(pd);
    FileOutputStream fos = new FileOutputStream("bla.ppt");
    ppt.createSlide();
    ppt.write(fos);
    fos.close();
}
Comment 2 Javen O'Neal 2016-01-16 21:26:42 UTC
What revision was the test case from comment 1 added to the test suite?
Comment 3 Andreas Beeker 2016-01-16 22:56:16 UTC
(In reply to Javen O'Neal from comment #2)
> What revision was the test case from comment 1 added to the test suite?

I haven't added the test case, as this was a visual test only.
I usually only add testcases, when I've changed something on the code for it.