* @param expressPPr
* @return
*/
public PPr getEffectivePPr(String styleId) {
PPr resolvedPPr = resolvedStylePPrComponent.get(styleId);
if (resolvedPPr!=null) {
return resolvedPPr;
}
// Hmm, have to do the work
Style s = liveStyles.get(styleId);
if (s==null) {
log.error("Couldn't find style: " + styleId);
return null;
}
// PPr expressPPr = s.getPPr();
// if (expressPPr==null) {
// // A paragraph style may have no w:pPr component
// log.debug("style: " + styleId + " has no PPr");
// String normalId = this.styleDefinitionsPart.getDefaultParagraphStyle().getStyleId();
// resolvedPPr = resolvedStylePPrComponent.get(normalId);
// return resolvedPPr;
// }
// Next, paragraph and run properties are
// applied to each paragraph as defined by the paragraph style.
Stack<PPr> pPrStack = new Stack<PPr>();
// Haven't done this one yet
fillPPrStack(styleId, pPrStack);
// Finally, on top
pPrStack.push(documentDefaultPPr);
resolvedPPr = factory.createPPr();
// Now, apply the properties starting at the top of the stack
while (!pPrStack.empty() ) {
PPr pPr = pPrStack.pop();
applyPPr(pPr, resolvedPPr);
}
resolvedStylePPrComponent.put(styleId, resolvedPPr);
return resolvedPPr;
}