Search in sources :

Example 1 with XWPFAbstractNum

use of org.apache.poi.xwpf.usermodel.XWPFAbstractNum in project tika by apache.

the class XWPFListManager method loadLevelTuples.

private ParagraphLevelCounter loadLevelTuples(CTDecimalNumber abNum) {
    //Unfortunately, we need to go this far into the underlying structure
    //to get the abstract num information for the edge case where
    //someone skips a level and the format is not context-free, e.g. "1.B.i".
    XWPFAbstractNum abstractNum = numbering.getAbstractNum(abNum.getVal());
    CTAbstractNum ctAbstractNum = abstractNum.getCTAbstractNum();
    LevelTuple[] levels = new LevelTuple[ctAbstractNum.sizeOfLvlArray()];
    for (int i = 0; i < levels.length; i++) {
        levels[i] = buildTuple(i, ctAbstractNum.getLvlArray(i));
    }
    return new ParagraphLevelCounter(levels);
}
Also used : XWPFAbstractNum(org.apache.poi.xwpf.usermodel.XWPFAbstractNum) CTAbstractNum(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTAbstractNum)

Aggregations

XWPFAbstractNum (org.apache.poi.xwpf.usermodel.XWPFAbstractNum)1 CTAbstractNum (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTAbstractNum)1