[bug-66079] try to fix issue with XWPFNumbering.removeAbstractNum

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1901083 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-05-20 09:47:16 +00:00
parent 9527312287
commit a0ce6b6728
1 changed files with 9 additions and 1 deletions

View File

@ -240,8 +240,16 @@ public class XWPFNumbering extends POIXMLDocumentPart {
for (XWPFAbstractNum abstractNum : abstractNums) { for (XWPFAbstractNum abstractNum : abstractNums) {
BigInteger foundNumId = abstractNum.getAbstractNum().getAbstractNumId(); BigInteger foundNumId = abstractNum.getAbstractNum().getAbstractNumId();
if(abstractNumID.equals(foundNumId)) { if(abstractNumID.equals(foundNumId)) {
ctNumbering.removeAbstractNum(foundNumId.byteValue());
abstractNums.remove(abstractNum); abstractNums.remove(abstractNum);
break;
}
}
for (int i = 0; i < ctNumbering.sizeOfAbstractNumArray(); i++) {
CTAbstractNum ctAbstractNum = ctNumbering.getAbstractNumArray(i);
BigInteger foundNumId = ctAbstractNum.getAbstractNumId();
if(abstractNumID.equals(foundNumId)) {
ctNumbering.removeAbstractNum(i);
return true; return true;
} }
} }