log.debug("no explicit numId; no style either");
return null;
}
log.debug("no explicit numId; looking in styles");
PPr ppr = propertyResolver.getEffectivePPr(pStyleVal);
if (ppr == null) {
log.debug("Style '" + pStyleVal + "' has no pPr");
// System.out.println("Style '" + pStyleVal + "' has no pPr");
// System.out.println(
// org.docx4j.XmlUtils.marshaltoString(style, true, true)
// );
return null;
}
NumPr numPr = ppr.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.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";
}
}
}
log.debug("Using numId: " + numId);
if (levelId == null || levelId.equals("")) {
// String numId = getAttributeValue(numIdNode, ValAttrName);
log.warn("No level id?! Default to 0.");
levelId="0";
}
if (numberingPart.getInstanceListDefinitions().containsKey(numId)
&& numberingPart.getInstanceListDefinitions().get(numId).LevelExists(
levelId)) {
numberingPart.getInstanceListDefinitions().get(numId).IncrementCounter(
levelId);
triple.numString = numberingPart.getInstanceListDefinitions().get(numId)
.GetCurrentNumberString(levelId);
log.debug("Got number: " + triple.numString);
String font = numberingPart.getInstanceListDefinitions().get(numId)
.GetFont(levelId);
if (font != null && !font.equals("")) {
triple.numFont = font;
}
if (numberingPart.getInstanceListDefinitions().get(numId).IsBullet(levelId)) {
//triple.isBullet = true;
triple.bullet = numberingPart.getInstanceListDefinitions().get(numId).getLevel(levelId).getLevelText();
}
triple.lvl = numberingPart.getInstanceListDefinitions().get(numId).getLevel(levelId).getJaxbAbstractLvl();
PPr ppr = triple.getLvl().getPPr();
if (ppr!=null) {
triple.ind = ppr.getInd();
}
triple.rPr = triple.getLvl().getRPr();
} else if (!numberingPart.getInstanceListDefinitions().containsKey(numId)){