mirror of https://github.com/apache/poi.git
#65282 - addRun method only adds to run collection, missing iRun collection
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1889551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
053ae3618d
commit
841d558018
|
@ -1852,6 +1852,7 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
|
|||
public void addRun(XWPFRun r) {
|
||||
if (!runs.contains(r)) {
|
||||
runs.add(r);
|
||||
iruns.add(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -330,15 +330,23 @@ public final class TestXWPFParagraph {
|
|||
|
||||
XWPFParagraph p = doc.getParagraphs().get(0);
|
||||
assertEquals(2, p.getRuns().size());
|
||||
assertEquals(2, p.getIRuns().size());
|
||||
|
||||
XWPFRun r = p.createRun();
|
||||
assertEquals(3, p.getRuns().size());
|
||||
assertEquals(2, p.getRuns().indexOf(r));
|
||||
|
||||
assertEquals(3, p.getIRuns().size());
|
||||
assertEquals(2, p.getIRuns().indexOf(r));
|
||||
|
||||
XWPFRun r2 = p.insertNewRun(1);
|
||||
assertEquals(4, p.getRuns().size());
|
||||
assertEquals(1, p.getRuns().indexOf(r2));
|
||||
assertEquals(3, p.getRuns().indexOf(r));
|
||||
|
||||
assertEquals(4, p.getIRuns().size());
|
||||
assertEquals(1, p.getIRuns().indexOf(r2));
|
||||
assertEquals(3, p.getIRuns().indexOf(r));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue