private String convertToNewNumberText(String numberText, byte[] numberOffsets) {

        StringBuilder sb = new StringBuilder();
        int last = 0;
        for (int offset : numberOffsets) {
            if (offset == 0) {
                break;
            }
            if (offset - 1 < last || offset > numberText.length()) {
                //something went wrong.
                //silently stop
                break;
            }
            sb.append(numberText, last, offset - 1);
            //need to add one because newer format
            //adds one.  In .doc, this was the array index;
            //but in .docx, this is the level number
            int lvlNum = (int) numberText.charAt(offset - 1) + 1;
            sb.append("%").append(lvlNum);
            last = offset;
        }
        if (last < numberText.length()) {
            sb.append(numberText.substring(last));
        }
        return sb.toString();
    }
Get the formatted number for a given paragraph
<p/>
<p><em>Note:</em> This only works correctly if called subsequently for <em>all</em>
paragraphs in a valid selection (main document, text field, ...) which are part of a list
.</p>

@param paragraph list paragraph to process
@return String which represents the numbering of this list paragraph; never {@code null},
can be empty string, though,
if something goes wrong in getList()
@throws IllegalArgumentException If the given paragraph is {@code null} or is not part of
a list
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/ListManager.java