https://bz.apache.org/bugzilla/show_bug.cgi?id=66079

            Bug ID: 66079
           Summary: XWPFNumbering.removeAbstractNum still removes by list
                    index, not abstractNumId
           Product: POI
           Version: 5.2.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

There was bug #63788, bit it wasn't fixed properly. Here is what I am talking
about, org.apache.poi.xwpf.usermodel.XWPFNumbering#removeAbstractNum :

    public boolean removeAbstractNum(BigInteger abstractNumID) {
        for (XWPFAbstractNum abstractNum : abstractNums) {
            BigInteger foundNumId =
abstractNum.getAbstractNum().getAbstractNumId();
            if(abstractNumID.equals(foundNumId)) {
                ctNumbering.removeAbstractNum(foundNumId.byteValue());  <--
still uses index, not id
                abstractNums.remove(abstractNum);                       <--
works fine
                return true;
            }
        }

        return false;
    }

And so, in test63788 - abstract numbering with id 2 is deleted from
abstractNums, but from ctNumbering, that is actually what will be written to
file when writing .docx - numbering with id 7 is deleted.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to