diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-05-20 09:47:16 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-05-20 09:47:16 +0000 |
commit | a0ce6b67286a06d3244995f5af655d91136f0550 (patch) | |
tree | 39623dc9f9249ecd265f4a1f4454aa611604769b | |
parent | 95273122874d10805917451fddbfcac7dcb5d7d6 (diff) | |
download | poi-a0ce6b67286a06d3244995f5af655d91136f0550.tar.gz poi-a0ce6b67286a06d3244995f5af655d91136f0550.zip |
[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
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java index 2ff4f4c5eb..62131cafd5 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java @@ -240,8 +240,16 @@ public class XWPFNumbering extends POIXMLDocumentPart { for (XWPFAbstractNum abstractNum : abstractNums) { BigInteger foundNumId = abstractNum.getAbstractNum().getAbstractNumId(); if(abstractNumID.equals(foundNumId)) { - ctNumbering.removeAbstractNum(foundNumId.byteValue()); 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; } } |