use of org.apache.poi.hslf.usermodel.HSLFTextParagraph in project poi by apache.
the class TestSlideMaster method testTitleMaster.
/**
* Slide 3 has title layout and follows the TitleMaster. Verify that.
*/
@Test
public void testTitleMaster() throws IOException {
HSLFSlideShow ppt = new HSLFSlideShow(_slTests.openResourceAsStream("slide_master.ppt"));
HSLFSlide slide = ppt.getSlides().get(2);
HSLFMasterSheet masterSheet = slide.getMasterSheet();
assertTrue(masterSheet instanceof HSLFTitleMaster);
for (List<HSLFTextParagraph> txt : slide.getTextParagraphs()) {
HSLFTextRun rt = txt.get(0).getTextRuns().get(0);
switch(txt.get(0).getRunType()) {
case TextHeaderAtom.CENTER_TITLE_TYPE:
assertEquals("Arial", rt.getFontFamily());
assertEquals(32, rt.getFontSize(), 0);
assertEquals(true, rt.isBold());
assertEquals(true, rt.isUnderlined());
break;
case TextHeaderAtom.CENTRE_BODY_TYPE:
assertEquals("Courier New", rt.getFontFamily());
assertEquals(20, rt.getFontSize(), 0);
assertEquals(true, rt.isBold());
assertEquals(false, rt.isUnderlined());
break;
}
}
ppt.close();
}
Aggregations