Below is the source code of insertNewRun in *XWPFParagraph *:
public XWPFRun insertNewRun(int pos){
if (pos >= 0 && pos <= paragraph.sizeOfRArray()) {
CTR ctRun = paragraph.insertNewR(pos);
XWPFRun newRun = new XWPFRun(ctRun, this);
*runs.add(newRun);*
return newRun;
}
return null;
}
Why isn't the boldfaced part *runs.add(newRun, post);* instead? The current
code will add the newRun to the correct position for the underlying CTRun
list, but will always add the XWPFRun to the *end* of the XWPFRun list,
which doesn't seem to be the right behavior.
Thanks.
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/XWPFParagraph-Strange-insertNewRun-int-pos-tp5716665.html
Sent from the POI - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]