]> source.dussan.org Git - poi.git/commitdiff
Fix deprecated warnings
authorNick Burch <nick@apache.org>
Fri, 2 Jul 2010 21:35:06 +0000 (21:35 +0000)
committerNick Burch <nick@apache.org>
Fri, 2 Jul 2010 21:35:06 +0000 (21:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@960115 13f79535-47bb-0310-9956-ffa450edef68

14 files changed:
src/ooxml/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java
src/ooxml/java/org/apache/poi/xwpf/model/XWPFHeaderFooterPolicy.java
src/ooxml/java/org/apache/poi/xwpf/model/XWPFHyperlinkDecorator.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFComment.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFFootnote.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFHeaderFooter.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFLatentStyles.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFStyles.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTableRow.java

index 0ceb8accb17e55fb0af42e5a07775714df1470e1..7a528237a1c143ab78a143e5b011970e66dcf595 100644 (file)
@@ -39,7 +39,7 @@ public class XWPFCommentsDecorator extends XWPFParagraphDecorator {
                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());
index 7c90a59baa206c65c93180577e623772813b8432..3316435190b11bd5d179b8a44b36e00e49f1dcc1 100644 (file)
@@ -242,8 +242,8 @@ public class XWPFHeaderFooterPolicy {
                }
                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();
@@ -274,8 +274,8 @@ public class XWPFHeaderFooterPolicy {
                }
                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();
@@ -400,8 +400,8 @@ public class XWPFHeaderFooterPolicy {
         */
        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();
index 4be1e302bc7af0d3a0c4897cdc8f7eab23ef162c..3ad4c492d396a5a2fed3621f74b6760c337458ed 100644 (file)
@@ -49,10 +49,10 @@ public class XWPFHyperlinkDecorator extends XWPFParagraphDecorator {
                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());
                                }
                        }
index 72596085d3c59ed9869843e2c1fc3318dffa5412..1f8e799fc240aad4c8da7d372c2a6c132a5b4f68 100644 (file)
@@ -37,7 +37,7 @@ public class XWPFComment
         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());
index a7adc3356f6d64a5b0b1472382a413422c532d87..9f1acbbea7fe9aa4952804e7d19ebbb46217e347 100644 (file)
@@ -179,7 +179,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
 
                 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));
                     }
                 }
@@ -217,13 +217,13 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
             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));
                 }
             }
@@ -944,7 +944,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
        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;
index b3e30b8e0f5cf60a3b2b95d9d6749eb68f9a6dc0..e52e4fc0ab9d9170f48d07cd0f6978428ee566e0 100644 (file)
@@ -27,7 +27,7 @@ public class XWPFFootnote implements Iterable<XWPFParagraph> {
     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));
         }
     }
index af870718eb93ee4f9e6f72382bef7049ccbf04bd..fe24efcd34609a8bb3eac2bb47bb5e88f1f9a38c 100644 (file)
@@ -457,7 +457,7 @@ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBo
        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;
index e04dc914f4bc889f27cb00bd663c1fcd5a6b377b..a0a586313bd59ccb1ab1f7fc15846b4c847cd240 100644 (file)
@@ -39,7 +39,7 @@ public class XWPFLatentStyles {
         * 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;
                }
index 267491ff9e736d8373961b41d2d746ee42a2ac64..9bf7f1b33dc1a7dd015b1bd56e90e7e4ff17d2e5 100644 (file)
@@ -72,10 +72,10 @@ public class XWPFNumbering extends POIXMLDocumentPart {
                        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;
@@ -129,7 +129,7 @@ public class XWPFNumbering extends POIXMLDocumentPart {
         */
        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();
index e0741e782a5ec00cf99c28562c253a24484c040f..fed5b097d8889f8b81cd341f90dd08c91810a1c0 100644 (file)
@@ -18,12 +18,9 @@ package org.apache.poi.xwpf.usermodel;
 
 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;
@@ -46,7 +43,6 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSdtContentRun;
 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;
@@ -1139,10 +1135,10 @@ public class XWPFParagraph implements IBodyElement{
      */
     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());      
                }
     }
@@ -1162,7 +1158,7 @@ public class XWPFParagraph implements IBodyElement{
                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();
@@ -1246,7 +1242,7 @@ public class XWPFParagraph implements IBodyElement{
     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)
index c041030e8d9436bc0565b9a57e31e9b8afeadcc3..6dcaf5c72a3b7e843d14b94db30a94e3be4d0835 100644 (file)
@@ -127,7 +127,7 @@ public class XWPFRun {
      * @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());
     }
 
     /**
index f2328824c960cb43483c2533ab2abd03ebfb4d0e..6b6173f3147eac6bcf3193722b8abc3541668116 100644 (file)
@@ -75,7 +75,7 @@ public class XWPFStyles extends POIXMLDocumentPart{
                        throw new POIXMLException();
                }
         //get any Style
-        for(CTStyle style : ctStyles.getStyleArray()) {
+        for(CTStyle style : ctStyles.getStyleList()) {
             listStyle.add(new XWPFStyle(style, this));
         }
        }
@@ -117,7 +117,7 @@ public class XWPFStyles extends POIXMLDocumentPart{
        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());
        }
        /**
index 429eb623b3da0dede31a833ca7d957d5665d16e3..79262b2ddd0eafe2cb7973a8ddbb14b5033d000b 100644 (file)
@@ -71,12 +71,12 @@ public class XWPFTable implements IBodyElement{
         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');
index 4ac301476fd899c3eaecfd91e5cf4faee967c33c..01996dc49e89aba219b4f19998d1f236c237e304 100644 (file)
@@ -127,7 +127,7 @@ public class XWPFTableRow {
     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;