assertNull(masterShape1.getSpPr().getXfrm());
masterShape1 = (XSLFTextShape)layout.getSlideMaster().getPlaceholder(ph1);
assertNotNull(masterShape1.getSpPr().getXfrm());
assertEquals(masterShape1.getAnchor(), shape1.getAnchor());
CTTextBodyProperties bodyPr1 = shape1.getTextBodyPr();
// none of the following properties are set in the shapes and fetched from the master shape
assertTrue(
!bodyPr1.isSetLIns() && !bodyPr1.isSetRIns() &&
!bodyPr1.isSetBIns() && !bodyPr1.isSetTIns() &&
!bodyPr1.isSetAnchor()
);
assertEquals(7.2, shape1.getLeftInset()); // 0.1"
assertEquals(7.2, shape1.getRightInset()); // 0.1"
assertEquals(3.6, shape1.getTopInset()); // 0.05"
assertEquals(3.6, shape1.getBottomInset()); // 0.05"
assertEquals(VerticalAlignment.MIDDLE, shape1.getVerticalAlignment());
// now check text properties
assertEquals("Title", shape1.getText());
XSLFTextRun r1 = shape1.getTextParagraphs().get(0).getTextRuns().get(0);
assertEquals("Calibri", r1.getFontFamily());
assertEquals(44.0, r1.getFontSize());
assertEquals(Color.black, r1.getFontColor());
XSLFTextShape shape2 = (XSLFTextShape)shapes[1];
CTPlaceholder ph2 = shape2.getCTPlaceholder();
assertFalse(ph2.isSetType()); // <p:ph idx="1"/>
assertTrue(ph2.isSetIdx());
assertEquals(1, ph2.getIdx());
// anchor is not defined in the shape
assertNull(shape2.getSpPr().getXfrm());
XSLFTextShape masterShape2 = (XSLFTextShape)layout.getPlaceholder(ph2);
// anchor of the body text is missing in the slide layout, llokup in the slide master
assertNull(masterShape2.getSpPr().getXfrm());
masterShape2 = (XSLFTextShape)layout.getSlideMaster().getPlaceholder(ph2);
assertNotNull(masterShape2.getSpPr().getXfrm());
assertEquals(masterShape2.getAnchor(), shape2.getAnchor());
CTTextBodyProperties bodyPr2 = shape2.getTextBodyPr();
// none of the following properties are set in the shapes and fetched from the master shape
assertTrue(
!bodyPr2.isSetLIns() && !bodyPr2.isSetRIns() &&
!bodyPr2.isSetBIns() && !bodyPr2.isSetTIns() &&
!bodyPr2.isSetAnchor()
);
assertEquals(7.2, shape2.getLeftInset()); // 0.1"
assertEquals(7.2, shape2.getRightInset()); // 0.1"
assertEquals(3.6, shape2.getTopInset()); // 0.05"
assertEquals(3.6, shape2.getBottomInset()); // 0.05"