XWPFComment comment;
commentText = new StringBuffer();
- for(CTMarkupRange anchor : paragraph.getCTP().getCommentRangeStartArray())
+ for(CTMarkupRange anchor : paragraph.getCTP().getCommentRangeStartList())
{
if((comment = paragraph.getDocument().getCommentByID(anchor.getId().toString())) != null)
commentText.append("\tComment by " + comment.getAuthor()+": "+comment.getText());
}
else {
CTP p = ftr.addNewP();
- byte[] rsidr = doc.getDocument().getBody().getPArray()[0].getRsidR();
- byte[] rsidrdefault = doc.getDocument().getBody().getPArray()[0].getRsidRDefault();
+ byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
+ byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
p.setRsidP(rsidr);
p.setRsidRDefault(rsidrdefault);
CTPPr pPr = p.addNewPPr();
}
else {
CTP p = ftr.addNewP();
- byte[] rsidr = doc.getDocument().getBody().getPArray()[0].getRsidR();
- byte[] rsidrdefault = doc.getDocument().getBody().getPArray()[0].getRsidRDefault();
+ byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
+ byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
p.setRsidP(rsidr);
p.setRsidRDefault(rsidrdefault);
CTPPr pPr = p.addNewPPr();
*/
private XWPFParagraph getWatermarkParagraph(String text, int idx) {
CTP p = CTP.Factory.newInstance();
- byte[] rsidr = doc.getDocument().getBody().getPArray()[0].getRsidR();
- byte[] rsidrdefault = doc.getDocument().getBody().getPArray()[0].getRsidRDefault();
+ byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
+ byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
p.setRsidP(rsidr);
p.setRsidRDefault(rsidrdefault);
CTPPr pPr = p.addNewPPr();
hyperlinkText = new StringBuffer();
// loop over hyperlink anchors
- for(CTHyperlink link : paragraph.getCTP().getHyperlinkArray()){
- for (CTR r : link.getRArray()) {
+ for(CTHyperlink link : paragraph.getCTP().getHyperlinkList()){
+ for (CTR r : link.getRList()) {
// Loop over text runs
- for (CTText text : r.getTArray()){
+ for (CTText text : r.getTList()){
hyperlinkText.append(text.getStringValue());
}
}
id = comment.getId().toString();
author = comment.getAuthor();
- for(CTP ctp : comment.getPArray())
+ for(CTP ctp : comment.getPList())
{
XWPFParagraph p = new XWPFParagraph(ctp, null);
text.append(p.getText());
else if(relation.equals(XWPFRelation.COMMENT.getRelation())){
CommentsDocument cmntdoc = CommentsDocument.Factory.parse(p.getPackagePart().getInputStream());
- for(CTComment ctcomment : cmntdoc.getComments().getCommentArray()) {
+ for(CTComment ctcomment : cmntdoc.getComments().getCommentList()) {
comments.add(new XWPFComment(ctcomment));
}
}
if(relation.equals(XWPFRelation.FOOTNOTE.getRelation())){
FootnotesDocument footnotesDocument = FootnotesDocument.Factory.parse(p.getPackagePart().getInputStream());
- for(CTFtnEdn ctFtnEdn : footnotesDocument.getFootnotes().getFootnoteArray()) {
+ for(CTFtnEdn ctFtnEdn : footnotesDocument.getFootnotes().getFootnoteList()) {
footnotes.put(ctFtnEdn.getId().intValue(), new XWPFFootnote(this, ctFtnEdn));
}
} else if (relation.equals(XWPFRelation.ENDNOTE.getRelation())){
EndnotesDocument endnotesDocument = EndnotesDocument.Factory.parse(p.getPackagePart().getInputStream());
- for(CTFtnEdn ctFtnEdn : endnotesDocument.getEndnotes().getEndnoteArray()) {
+ for(CTFtnEdn ctFtnEdn : endnotesDocument.getEndnotes().getEndnoteList()) {
endnotes.put(ctFtnEdn.getId().intValue(), new XWPFFootnote(this, ctFtnEdn));
}
}
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i;
- for (i = 0; i < ctDocument.getBody().getTblArray().length; i++) {
+ for (i = 0; i < ctDocument.getBody().getTblList().size(); i++) {
CTTbl tbl = ctDocument.getBody().getTblArray(i);
if(tbl == table.getCTTbl()){
break;
private List<XWPFParagraph> paragraphs = new ArrayList<XWPFParagraph>();
public XWPFFootnote(XWPFDocument document, CTFtnEdn body) {
- for (CTP p : body.getPArray()) {
+ for (CTP p : body.getPList()) {
paragraphs.add(new XWPFParagraph(p, document));
}
}
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i;
- for (i = 0; i < headerFooter.getTblArray().length; i++) {
+ for (i = 0; i < headerFooter.getTblList().size(); i++) {
CTTbl tbl = headerFooter.getTblArray(i);
if(tbl == table.getCTTbl()){
break;
* checks wheter specific LatentStyleID is a latentStyle
*/
protected boolean isLatentStyle(String latentStyleID){
- for ( CTLsdException lsd: latentStyles.getLsdExceptionArray()) {
+ for ( CTLsdException lsd: latentStyles.getLsdExceptionList()) {
if(lsd.getName().equals(latentStyleID));
return true;
}
numberingDoc = NumberingDocument.Factory.parse(is);
ctNumbering = numberingDoc.getNumbering();
//get any Nums
- for(CTNum ctNum : ctNumbering.getNumArray()) {
+ for(CTNum ctNum : ctNumbering.getNumList()) {
nums.add(new XWPFNum(ctNum, this));
}
- for(CTAbstractNum ctAbstractNum : ctNumbering.getAbstractNumArray()){
+ for(CTAbstractNum ctAbstractNum : ctNumbering.getAbstractNumList()){
abstractNums.add(new XWPFAbstractNum(ctAbstractNum, this));
}
isNew = false;
*/
public BigInteger addNum(XWPFNum num){
ctNumbering.addNewNum();
- int pos = (ctNumbering.getNumArray().length) - 1;
+ int pos = (ctNumbering.getNumList().size()) - 1;
ctNumbering.setNumArray(pos, num.getCTNum());
nums.add(num);
return num.getCTNum().getNumId();
import java.math.BigInteger;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.util.Internal;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtRun;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSpacing;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTextAlignment;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder;
*/
protected void addRun(CTR run){
int pos;
- pos = paragraph.getRArray().length;
+ pos = paragraph.getRList().size();
paragraph.addNewR();
paragraph.setRArray(pos, run);
- for (CTText ctText: paragraph.getRArray(pos).getTArray()) {
+ for (CTText ctText: paragraph.getRArray(pos).getTList()) {
this.text.append(ctText.getStringValue());
}
}
startChar = startPos.getChar();
int beginRunPos = 0, candCharPos = 0;
boolean newList = false;
- for (int runPos=startRun; runPos<paragraph.getRArray().length; runPos++) {
+ for (int runPos=startRun; runPos<paragraph.getRList().size(); runPos++) {
int beginTextPos = 0,beginCharPos = 0, textPos = 0, charPos = 0;
CTR ctRun = paragraph.getRArray(runPos);
XmlCursor c = ctRun.newCursor();
int charEnd = segment.getEndChar();
StringBuffer out = new StringBuffer();
for(int i=runBegin; i<=runEnd;i++){
- int startText=0, endText = paragraph.getRArray(i).getTArray().length-1;
+ int startText=0, endText = paragraph.getRArray(i).getTList().size()-1;
if(i==runBegin)
startText=textBegin;
if(i==runEnd)
* @param value the literal text which shall be displayed in the document
*/
public void setText(String value) {
- setText(value,run.getTArray().length);
+ setText(value,run.getTList().size());
}
/**
throw new POIXMLException();
}
//get any Style
- for(CTStyle style : ctStyles.getStyleArray()) {
+ for(CTStyle style : ctStyles.getStyleList()) {
listStyle.add(new XWPFStyle(style, this));
}
}
public void addStyle(XWPFStyle style){
listStyle.add(style);
ctStyles.addNewStyle();
- int pos = (ctStyles.getStyleArray().length) - 1;
+ int pos = (ctStyles.getStyleList().size()) - 1;
ctStyles.setStyleArray(pos, style.getCTStyle());
}
/**
if (table.sizeOfTrArray() == 0)
createEmptyTable(table);
- for (CTRow row : table.getTrArray()) {
+ for (CTRow row : table.getTrList()) {
StringBuffer rowText = new StringBuffer();
XWPFTableRow tabRow = new XWPFTableRow(row, this);
tableRows.add(tabRow);
- for (CTTc cell : row.getTcArray()) {
- for (CTP ctp : cell.getPArray()) {
+ for (CTTc cell : row.getTcList()) {
+ for (CTP ctp : cell.getPList()) {
XWPFParagraph p = new XWPFParagraph(ctp, part);
if (rowText.length() > 0) {
rowText.append('\t');
public List<XWPFTableCell> getTableCells(){
if(tableCells == null){
List<XWPFTableCell> cells = new ArrayList<XWPFTableCell>();
- for (CTTc tableCell : ctRow.getTcArray()) {
+ for (CTTc tableCell : ctRow.getTcList()) {
cells.add(new XWPFTableCell(tableCell, this, table.getPart()));
}
this.tableCells = cells;