use of org.apache.poi.xwpf.usermodel.XWPFNum in project tika by apache.
the class XWPFListManager method getFormattedNumber.
public String getFormattedNumber(BigInteger numId, int iLvl) {
if (numbering == null || iLvl < 0 || numId == null) {
return "";
}
int currNumId = numId.intValue();
XWPFNum xwpfNum = numbering.getNum(numId);
if (xwpfNum == null) {
return "";
}
CTNum ctNum = xwpfNum.getCTNum();
CTDecimalNumber abNum = ctNum.getAbstractNumId();
int currAbNumId = abNum.getVal().intValue();
ParagraphLevelCounter lc = listLevelMap.get(currAbNumId);
LevelTuple[] overrideTuples = overrideTupleMap.get(currNumId);
if (lc == null) {
lc = loadLevelTuples(abNum);
}
if (overrideTuples == null) {
overrideTuples = loadOverrideTuples(ctNum, lc.getNumberOfLevels());
}
String formattedString = lc.incrementLevel(iLvl, overrideTuples);
listLevelMap.put(currAbNumId, lc);
overrideTupleMap.put(currNumId, overrideTuples);
return formattedString;
}
Aggregations