From 014cfcdc80208d0fc36d300ca59c1ae071015a56 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Tue, 22 Jun 2010 13:59:44 +0000 Subject: [PATCH] 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 --- src/ooxml/java/org/apache/poi/POIXMLProperties.java | 4 ++-- .../org/apache/poi/POIXMLPropertiesTextExtractor.java | 7 ++++--- src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java | 2 +- .../poi/xslf/extractor/XSLFPowerPointExtractor.java | 2 +- .../org/apache/poi/xslf/usermodel/DrawingTable.java | 8 +++++--- .../apache/poi/xslf/usermodel/DrawingTableRow.java | 8 +++++--- .../apache/poi/xslf/usermodel/DrawingTextBody.java | 8 +++++--- .../org/apache/poi/xslf/usermodel/XMLSlideShow.java | 2 +- .../poi/xslf/usermodel/XSLFCommonSlideData.java | 11 +++++------ .../apache/poi/xssf/eventusermodel/XSSFReader.java | 3 +-- 10 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/POIXMLProperties.java b/src/ooxml/java/org/apache/poi/POIXMLProperties.java index 6717c903ac..3fa35341e5 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLProperties.java +++ b/src/ooxml/java/org/apache/poi/POIXMLProperties.java @@ -369,7 +369,7 @@ public class POIXMLProperties { */ 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; @@ -382,7 +382,7 @@ public class POIXMLProperties { * @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; diff --git a/src/ooxml/java/org/apache/poi/POIXMLPropertiesTextExtractor.java b/src/ooxml/java/org/apache/poi/POIXMLPropertiesTextExtractor.java index 6d31340557..22ff8902c3 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLPropertiesTextExtractor.java +++ b/src/ooxml/java/org/apache/poi/POIXMLPropertiesTextExtractor.java @@ -21,6 +21,7 @@ import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; import org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty; import java.util.Date; +import java.util.List; /** * A {@link POITextExtractor} for returning the textual @@ -129,13 +130,13 @@ public class POIXMLPropertiesTextExtractor extends POIXMLTextExtractor { org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperties props = getDocument().getProperties().getCustomProperties().getUnderlyingProperties(); - CTProperty[] properties = props.getPropertyArray(); - for(int i = 0; i properties = props.getPropertyList(); + for(int i = 0; i(); - for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdArray()) { + for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdList()) { PackagePart slidePart = getTargetPart(getCorePart().getRelationship(ctSlide.getId2())); diff --git a/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java b/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java index bcbf176d27..fa4c77f8c0 100644 --- a/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java +++ b/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java @@ -104,7 +104,7 @@ public class XSLFPowerPointExtractor extends POIXMLTextExtractor { // 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( diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java index 037ae65d92..e221cfa7cc 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java @@ -17,6 +17,8 @@ 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; @@ -28,11 +30,11 @@ public class DrawingTable { } public DrawingTableRow[] getRows() { - CTTableRow[] ctTableRows = table.getTrArray(); - DrawingTableRow[] o = new DrawingTableRow[ctTableRows.length]; + List ctTableRows = table.getTrList(); + DrawingTableRow[] o = new DrawingTableRow[ctTableRows.size()]; for (int i=0; i ctTableCells = row.getTcList(); + DrawingTableCell[] o = new DrawingTableCell[ctTableCells.size()]; for (int i=0; i paragraphs = textBody.getPList(); + DrawingParagraph[] o = new DrawingParagraph[paragraphs.size()]; for (int i=0; i out) { - CTShape[] shapes = gs.getSpArray(); - for (int i = 0; i < shapes.length; i++) { - CTTextBody ctTextBody = shapes[i].getTxBody(); + List shapes = gs.getSpList(); + for (int i = 0; i < shapes.size(); i++) { + CTTextBody ctTextBody = shapes.get(i).getTxBody(); if (ctTextBody==null) { continue; } diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java index 6814be8c91..991d6661d3 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java @@ -19,7 +19,6 @@ package org.apache.poi.xssf.eventusermodel; 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; @@ -186,7 +185,7 @@ public class XSSFReader { //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){ -- 2.39.5