ResolvedLayout resolvedLayout = new ResolvedLayout();
// Does this slide reference a layout explicitly?
// .. sometimes it doesn't.
SlideLayoutPart layoutPart = null;
// Need these for images etc
resolvedLayout.relationships = slidePart.getRelationshipsPart();
Relationship rel = slidePart.getRelationshipsPart().getRelationshipByType(
Namespaces.PRESENTATIONML_SLIDE_LAYOUT);
if (rel==null) {
log.warn(slidePart.getPartName().getName() + " has no explicit layout!");
// This happens at least some of the time.
// eg for title slide
// That case is ok, since CTR_TITLE and SUB_TITLE only occur
// once across layouts. But others aren't unique;
// they can be partially disambiguated using p:cNvPr/@name
Map<String, ShapeWrapper> globalPlaceHolders = ((PresentationMLPackage)slidePart.getPackage())
.getPlaceHoldersFromAcrossLayouts();
// These are resolved placeholders :-)
// ShapeTree
resolvedLayout.shapeTree =
createEffectiveShapeTree( slidePart.getJaxbElement().getCSld().getSpTree(),
globalPlaceHolders );
} else {
// Usual case
layoutPart = (SlideLayoutPart)slidePart.getRelationshipsPart().getPart(rel);
// ShapeTree
resolvedLayout.shapeTree =
createEffectiveShapeTree( slidePart.getJaxbElement().getCSld().getSpTree(),
layoutPart.getIndexedPlaceHolders() );
}
resolvedLayout.masterNumber = 1; // TODO FIXME
return resolvedLayout;