*/
protected int nextPid(){
int propid = 1;
- for(CTProperty p : props.getProperties().getPropertyArray()){
+ for(CTProperty p : props.getProperties().getPropertyList()){
if(p.getPid() > propid) propid = p.getPid();
}
return propid + 1;
* @return whether a property with the given name exists in the custom properties
*/
public boolean contains(String name){
- for(CTProperty p : props.getProperties().getPropertyArray()){
+ for(CTProperty p : props.getProperties().getPropertyList()){
if(p.getName().equals(name)) return true;
}
return false;
import org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty;
import java.util.Date;
+import java.util.List;
/**
* A {@link POITextExtractor} for returning the textual
org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperties
props = getDocument().getProperties().getCustomProperties().getUnderlyingProperties();
- CTProperty[] properties = props.getPropertyArray();
- for(int i = 0; i<properties.length; i++) {
+ List<CTProperty> properties = props.getPropertyList();
+ for(int i = 0; i<properties.size(); i++) {
// TODO - finish off
String val = "(not implemented!)";
text.append(
- properties[i].getName() +
+ properties.get(i).getName() +
" = " + val + "\n"
);
}
PresentationDocument.Factory.parse(getCorePart().getInputStream());
embedds = new LinkedList<PackagePart>();
- for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdArray()) {
+ for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdList()) {
PackagePart slidePart =
getTargetPart(getCorePart().getRelationship(ctSlide.getId2()));
// Comments too for the slide
if(comments != null) {
- for(CTComment comment : comments.getCmArray()) {
+ for(CTComment comment : comments.getCmList()) {
// TODO - comment authors too
// (They're in another stream)
text.append(
package org.apache.poi.xslf.usermodel;
+import java.util.List;
+
import org.openxmlformats.schemas.drawingml.x2006.main.CTTable;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableRow;
}
public DrawingTableRow[] getRows() {
- CTTableRow[] ctTableRows = table.getTrArray();
- DrawingTableRow[] o = new DrawingTableRow[ctTableRows.length];
+ List<CTTableRow> ctTableRows = table.getTrList();
+ DrawingTableRow[] o = new DrawingTableRow[ctTableRows.size()];
for (int i=0; i<o.length; i++) {
- o[i] = new DrawingTableRow(ctTableRows[i]);
+ o[i] = new DrawingTableRow(ctTableRows.get(i));
}
return o;
package org.apache.poi.xslf.usermodel;
+import java.util.List;
+
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableRow;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell;
}
public DrawingTableCell[] getCells() {
- CTTableCell[] ctTableCells = row.getTcArray();
- DrawingTableCell[] o = new DrawingTableCell[ctTableCells.length];
+ List<CTTableCell> ctTableCells = row.getTcList();
+ DrawingTableCell[] o = new DrawingTableCell[ctTableCells.size()];
for (int i=0; i<o.length; i++) {
- o[i] = new DrawingTableCell(ctTableCells[i]);
+ o[i] = new DrawingTableCell(ctTableCells.get(i));
}
return o;
package org.apache.poi.xslf.usermodel;
+import java.util.List;
+
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
}
public DrawingParagraph[] getParagraphs() {
- CTTextParagraph[] pArray = textBody.getPArray();
- DrawingParagraph[] o = new DrawingParagraph[pArray.length];
+ List<CTTextParagraph> paragraphs = textBody.getPList();
+ DrawingParagraph[] o = new DrawingParagraph[paragraphs.size()];
for (int i=0; i<o.length; i++) {
- o[i] = new DrawingParagraph(pArray[i]);
+ o[i] = new DrawingParagraph(paragraphs.get(i));
}
return o;
// Build the slides list
CTSlideIdList slideIds = slideShow.getSlideReferences();
- slides = new XSLFSlide[slideIds.getSldIdArray().length];
+ slides = new XSLFSlide[slideIds.getSldIdList().size()];
for(int i=0; i<slides.length; i++) {
CTSlideIdListEntry slideId = slideIds.getSldIdArray(i);
CTSlide slide = slideShow.getSlide(slideId);
processShape(gs, out);
- for (CTGroupShape shape : gs.getGrpSpArray()) {
+ for (CTGroupShape shape : gs.getGrpSpList()) {
processShape(shape, out);
}
- CTGraphicalObjectFrame[] graphicFrames = gs.getGraphicFrameArray();
- for (CTGraphicalObjectFrame frame: graphicFrames) {
+ for (CTGraphicalObjectFrame frame: gs.getGraphicFrameList()) {
CTGraphicalObjectData data = frame.getGraphic().getGraphicData();
XmlCursor c = data.newCursor();
c.selectPath("./*");
}
private void processShape(CTGroupShape gs, List<DrawingParagraph> out) {
- CTShape[] shapes = gs.getSpArray();
- for (int i = 0; i < shapes.length; i++) {
- CTTextBody ctTextBody = shapes[i].getTxBody();
+ List<CTShape> shapes = gs.getSpList();
+ for (int i = 0; i < shapes.size(); i++) {
+ CTTextBody ctTextBody = shapes.get(i).getTxBody();
if (ctTextBody==null) {
continue;
}
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
//step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
//Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
- sheetIterator = Arrays.asList(wbBean.getSheets().getSheetArray()).iterator();
+ sheetIterator = wbBean.getSheets().getSheetList().iterator();
} catch (InvalidFormatException e){
throw new POIXMLException(e);
} catch (XmlException e){