mirror of https://github.com/apache/poi.git
Remove a few deprecated warnings for when compiling against ooxml-schemas-1.1
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@956900 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
55841a2954
commit
014cfcdc80
|
@ -369,7 +369,7 @@ public class POIXMLProperties {
|
||||||
*/
|
*/
|
||||||
protected int nextPid(){
|
protected int nextPid(){
|
||||||
int propid = 1;
|
int propid = 1;
|
||||||
for(CTProperty p : props.getProperties().getPropertyArray()){
|
for(CTProperty p : props.getProperties().getPropertyList()){
|
||||||
if(p.getPid() > propid) propid = p.getPid();
|
if(p.getPid() > propid) propid = p.getPid();
|
||||||
}
|
}
|
||||||
return propid + 1;
|
return propid + 1;
|
||||||
|
@ -382,7 +382,7 @@ public class POIXMLProperties {
|
||||||
* @return whether a property with the given name exists in the custom properties
|
* @return whether a property with the given name exists in the custom properties
|
||||||
*/
|
*/
|
||||||
public boolean contains(String name){
|
public boolean contains(String name){
|
||||||
for(CTProperty p : props.getProperties().getPropertyArray()){
|
for(CTProperty p : props.getProperties().getPropertyList()){
|
||||||
if(p.getName().equals(name)) return true;
|
if(p.getName().equals(name)) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart;
|
||||||
import org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty;
|
import org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link POITextExtractor} for returning the textual
|
* A {@link POITextExtractor} for returning the textual
|
||||||
|
@ -129,13 +130,13 @@ public class POIXMLPropertiesTextExtractor extends POIXMLTextExtractor {
|
||||||
org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperties
|
org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperties
|
||||||
props = getDocument().getProperties().getCustomProperties().getUnderlyingProperties();
|
props = getDocument().getProperties().getCustomProperties().getUnderlyingProperties();
|
||||||
|
|
||||||
CTProperty[] properties = props.getPropertyArray();
|
List<CTProperty> properties = props.getPropertyList();
|
||||||
for(int i = 0; i<properties.length; i++) {
|
for(int i = 0; i<properties.size(); i++) {
|
||||||
// TODO - finish off
|
// TODO - finish off
|
||||||
String val = "(not implemented!)";
|
String val = "(not implemented!)";
|
||||||
|
|
||||||
text.append(
|
text.append(
|
||||||
properties[i].getName() +
|
properties.get(i).getName() +
|
||||||
" = " + val + "\n"
|
" = " + val + "\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class XSLFSlideShow extends POIXMLDocument {
|
||||||
PresentationDocument.Factory.parse(getCorePart().getInputStream());
|
PresentationDocument.Factory.parse(getCorePart().getInputStream());
|
||||||
|
|
||||||
embedds = new LinkedList<PackagePart>();
|
embedds = new LinkedList<PackagePart>();
|
||||||
for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdArray()) {
|
for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdList()) {
|
||||||
PackagePart slidePart =
|
PackagePart slidePart =
|
||||||
getTargetPart(getCorePart().getRelationship(ctSlide.getId2()));
|
getTargetPart(getCorePart().getRelationship(ctSlide.getId2()));
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class XSLFPowerPointExtractor extends POIXMLTextExtractor {
|
||||||
|
|
||||||
// Comments too for the slide
|
// Comments too for the slide
|
||||||
if(comments != null) {
|
if(comments != null) {
|
||||||
for(CTComment comment : comments.getCmArray()) {
|
for(CTComment comment : comments.getCmList()) {
|
||||||
// TODO - comment authors too
|
// TODO - comment authors too
|
||||||
// (They're in another stream)
|
// (They're in another stream)
|
||||||
text.append(
|
text.append(
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package org.apache.poi.xslf.usermodel;
|
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.CTTable;
|
||||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableRow;
|
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableRow;
|
||||||
|
|
||||||
|
@ -28,11 +30,11 @@ public class DrawingTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrawingTableRow[] getRows() {
|
public DrawingTableRow[] getRows() {
|
||||||
CTTableRow[] ctTableRows = table.getTrArray();
|
List<CTTableRow> ctTableRows = table.getTrList();
|
||||||
DrawingTableRow[] o = new DrawingTableRow[ctTableRows.length];
|
DrawingTableRow[] o = new DrawingTableRow[ctTableRows.size()];
|
||||||
|
|
||||||
for (int i=0; i<o.length; i++) {
|
for (int i=0; i<o.length; i++) {
|
||||||
o[i] = new DrawingTableRow(ctTableRows[i]);
|
o[i] = new DrawingTableRow(ctTableRows.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package org.apache.poi.xslf.usermodel;
|
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.CTTableRow;
|
||||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell;
|
import org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell;
|
||||||
|
|
||||||
|
@ -28,11 +30,11 @@ public class DrawingTableRow {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrawingTableCell[] getCells() {
|
public DrawingTableCell[] getCells() {
|
||||||
CTTableCell[] ctTableCells = row.getTcArray();
|
List<CTTableCell> ctTableCells = row.getTcList();
|
||||||
DrawingTableCell[] o = new DrawingTableCell[ctTableCells.length];
|
DrawingTableCell[] o = new DrawingTableCell[ctTableCells.size()];
|
||||||
|
|
||||||
for (int i=0; i<o.length; i++) {
|
for (int i=0; i<o.length; i++) {
|
||||||
o[i] = new DrawingTableCell(ctTableCells[i]);
|
o[i] = new DrawingTableCell(ctTableCells.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
package org.apache.poi.xslf.usermodel;
|
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.CTTextBody;
|
||||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
|
import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
|
||||||
|
|
||||||
|
@ -28,11 +30,11 @@ public class DrawingTextBody {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrawingParagraph[] getParagraphs() {
|
public DrawingParagraph[] getParagraphs() {
|
||||||
CTTextParagraph[] pArray = textBody.getPArray();
|
List<CTTextParagraph> paragraphs = textBody.getPList();
|
||||||
DrawingParagraph[] o = new DrawingParagraph[pArray.length];
|
DrawingParagraph[] o = new DrawingParagraph[paragraphs.size()];
|
||||||
|
|
||||||
for (int i=0; i<o.length; i++) {
|
for (int i=0; i<o.length; i++) {
|
||||||
o[i] = new DrawingParagraph(pArray[i]);
|
o[i] = new DrawingParagraph(paragraphs.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
return o;
|
return o;
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class XMLSlideShow implements SlideShow {
|
||||||
|
|
||||||
// Build the slides list
|
// Build the slides list
|
||||||
CTSlideIdList slideIds = slideShow.getSlideReferences();
|
CTSlideIdList slideIds = slideShow.getSlideReferences();
|
||||||
slides = new XSLFSlide[slideIds.getSldIdArray().length];
|
slides = new XSLFSlide[slideIds.getSldIdList().size()];
|
||||||
for(int i=0; i<slides.length; i++) {
|
for(int i=0; i<slides.length; i++) {
|
||||||
CTSlideIdListEntry slideId = slideIds.getSldIdArray(i);
|
CTSlideIdListEntry slideId = slideIds.getSldIdArray(i);
|
||||||
CTSlide slide = slideShow.getSlide(slideId);
|
CTSlide slide = slideShow.getSlide(slideId);
|
||||||
|
|
|
@ -45,12 +45,11 @@ public class XSLFCommonSlideData {
|
||||||
|
|
||||||
processShape(gs, out);
|
processShape(gs, out);
|
||||||
|
|
||||||
for (CTGroupShape shape : gs.getGrpSpArray()) {
|
for (CTGroupShape shape : gs.getGrpSpList()) {
|
||||||
processShape(shape, out);
|
processShape(shape, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTGraphicalObjectFrame[] graphicFrames = gs.getGraphicFrameArray();
|
for (CTGraphicalObjectFrame frame: gs.getGraphicFrameList()) {
|
||||||
for (CTGraphicalObjectFrame frame: graphicFrames) {
|
|
||||||
CTGraphicalObjectData data = frame.getGraphic().getGraphicData();
|
CTGraphicalObjectData data = frame.getGraphic().getGraphicData();
|
||||||
XmlCursor c = data.newCursor();
|
XmlCursor c = data.newCursor();
|
||||||
c.selectPath("./*");
|
c.selectPath("./*");
|
||||||
|
@ -76,9 +75,9 @@ public class XSLFCommonSlideData {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processShape(CTGroupShape gs, List<DrawingParagraph> out) {
|
private void processShape(CTGroupShape gs, List<DrawingParagraph> out) {
|
||||||
CTShape[] shapes = gs.getSpArray();
|
List<CTShape> shapes = gs.getSpList();
|
||||||
for (int i = 0; i < shapes.length; i++) {
|
for (int i = 0; i < shapes.size(); i++) {
|
||||||
CTTextBody ctTextBody = shapes[i].getTxBody();
|
CTTextBody ctTextBody = shapes.get(i).getTxBody();
|
||||||
if (ctTextBody==null) {
|
if (ctTextBody==null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.poi.xssf.eventusermodel;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -186,7 +185,7 @@ public class XSSFReader {
|
||||||
//step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
|
//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
|
//Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
|
||||||
CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
|
CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
|
||||||
sheetIterator = Arrays.asList(wbBean.getSheets().getSheetArray()).iterator();
|
sheetIterator = wbBean.getSheets().getSheetList().iterator();
|
||||||
} catch (InvalidFormatException e){
|
} catch (InvalidFormatException e){
|
||||||
throw new POIXMLException(e);
|
throw new POIXMLException(e);
|
||||||
} catch (XmlException e){
|
} catch (XmlException e){
|
||||||
|
|
Loading…
Reference in New Issue