return null;
}
NumPr numPr = style.getPPr().getNumPr();
if (numPr==null) {
log.debug("Couldn't get NumPr from " + pStyleVal);
// log.debug(
// org.docx4j.XmlUtils.marshaltoString(style, true, true)
// );
// So there is no numbering set on the style either
// That's ok ..
return null;
}
if (numPr.getNumId()==null) {
log.debug("NumPr element has no numId");
if (pStyleVal==null) {
return null;
} else {
// use propertyResolver to follow <w:basedOn w:val="blagh"/>
log.debug(pStyleVal + ".. use propertyResolver to follow basedOn");
PPr ppr = propertyResolver.getEffectivePPr(pStyleVal);
numPr = ppr.getNumPr();
if (numPr==null) {
log.debug(pStyleVal + "NumPr element still has no numId (basedOn didn't help)");
return null; // Is this the right thing to do? Check!
} else {
log.info("Got numId: " + numPr.getNumId() );
}
}
}
if (numPr.getNumId()==null) {
log.error("numId was null!");
return null;
}
numId = numPr.getNumId().getVal().toString();
if (numId.equals("")) {
log.error("numId was empty!");
return null;
}
if (levelId == null
|| levelId.equals("") ) {
if (numPr.getIlvl() != null ) {
levelId = numPr.getIlvl().getVal().toString();
log.info("levelId=" + levelId + " (from style)" );
} else {
// default
levelId = "0";
}