// Should have 1 master
assertEquals(1, xml.getSlideMasterReferences().sizeOfSldMasterIdArray());
- assertEquals(1, xml.getSlideMasterReferences().getSldMasterIdArray().length);
+ assertEquals(1, xml.getSlideMasterReferences().getSldMasterIdList().size());
// Should have three sheets
assertEquals(2, xml.getSlideReferences().sizeOfSldIdArray());
- assertEquals(2, xml.getSlideReferences().getSldIdArray().length);
+ assertEquals(2, xml.getSlideReferences().getSldIdList().size());
// Check they're as expected
- CTSlideIdListEntry[] slides = xml.getSlideReferences().getSldIdArray();
+ CTSlideIdListEntry[] slides = new CTSlideIdListEntry[
+ xml.getSlideReferences().getSldIdList().size()];
+ xml.getSlideReferences().getSldIdList().toArray(slides);
+
assertEquals(256, slides[0].getId());
assertEquals(257, slides[1].getId());
assertEquals("rId2", slides[0].getId2());
assertNotNull(xml.getNotes(slides[1]));
// And again for the master
- CTSlideMasterIdListEntry[] masters =
- xml.getSlideMasterReferences().getSldMasterIdArray();
+ CTSlideMasterIdListEntry[] masters = new CTSlideMasterIdListEntry[
+ xml.getSlideMasterReferences().getSldMasterIdList().size()];
+ xml.getSlideMasterReferences().getSldMasterIdList().toArray(masters);
+
assertEquals(2147483648l, masters[0].getId());
assertEquals("rId1", masters[0].getId2());
assertNotNull(xml.getSlideMaster(masters[0]));
CalculationChain chain = wb.getCalculationChain();
//the bean holding the reference to the formula to be deleted
CTCalcCell c = chain.getCTCalcChain().getCArray(0);
- int cnt = chain.getCTCalcChain().getCArray().length;
+ int cnt = chain.getCTCalcChain().getCList().size();
assertEquals(10, c.getI());
assertEquals("E1", c.getR());
//the count of items is less by one
c = chain.getCTCalcChain().getCArray(0);
- int cnt2 = chain.getCTCalcChain().getCArray().length;
+ int cnt2 = chain.getCTCalcChain().getCList().size();
assertEquals(cnt - 1, cnt2);
//the first item in the calculation chain is the former second one
assertEquals(10, c.getI());
==================================================================== */
package org.apache.poi.xssf.model;
+import junit.framework.TestCase;
+
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.usermodel.XSSFMap;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSchema;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMapInfo;
import org.w3c.dom.Node;
-import junit.framework.TestCase;
-
/**
* @author Roberto Manicardi
*/
assertNotNull(ctMapInfo);
- CTSchema[] schemas = ctMapInfo.getSchemaArray();
- assertEquals(1, schemas.length);
-
+ assertEquals(1, ctMapInfo.getSchemaList().size());
for (XSSFMap map : mapInfo.getAllXSSFMaps()) {
Node xmlSchema = map.getSchema();
assertSame(comment.getString(), richText);
//check that the rich text is set in the comment
CTRPrElt rPr = richText.getCTRst().getRArray(0).getRPr();
- assertEquals(true, rPr.getIArray()[0].getVal());
- assertEquals(8.5, rPr.getSzArray()[0].getVal());
- assertEquals(IndexedColors.BLUE_GREY.getIndex(), rPr.getColorArray()[0].getIndexed());
- assertEquals("Tahoma", rPr.getRFontArray()[0].getVal());
+ assertEquals(true, rPr.getIArray(0).getVal());
+ assertEquals(8.5, rPr.getSzArray(0).getVal());
+ assertEquals(IndexedColors.BLUE_GREY.getIndex(), rPr.getColorArray(0).getIndexed());
+ assertEquals("Tahoma", rPr.getRFontArray(0).getVal());
}
public void testAuthor() {
xssfFont.setBold(true);
- assertEquals(ctFont.getBArray().length,1);
+ assertEquals(ctFont.getBList().size(),1);
assertEquals(true, ctFont.getBArray(0).getVal());
}
assertEquals(false, xssfFont.getItalic());
xssfFont.setItalic(true);
- assertEquals(ctFont.getIArray().length,1);
+ assertEquals(ctFont.getIList().size(),1);
assertEquals(true, ctFont.getIArray(0).getVal());
assertEquals(true,ctFont.getIArray(0).getVal());
}
assertEquals(false, xssfFont.getStrikeout());
xssfFont.setStrikeout(true);
- assertEquals(ctFont.getStrikeArray().length,1);
+ assertEquals(ctFont.getStrikeList().size(),1);
assertEquals(true, ctFont.getStrikeArray(0).getVal());
assertEquals(true,ctFont.getStrikeArray(0).getVal());
}
assertEquals(Font.U_SINGLE, xssfFont.getUnderline());
xssfFont.setUnderline(Font.U_DOUBLE);
- assertEquals(ctFont.getUArray().length,1);
+ assertEquals(ctFont.getUList().size(),1);
assertEquals(STUnderlineValues.DOUBLE,ctFont.getUArray(0).getVal());
xssfFont.setUnderline(FontUnderline.DOUBLE_ACCOUNTING);
- assertEquals(ctFont.getUArray().length,1);
+ assertEquals(ctFont.getUList().size(),1);
assertEquals(STUnderlineValues.DOUBLE_ACCOUNTING,ctFont.getUArray(0).getVal());
}
sheet.groupColumn(10, 11);
CTCols cols = sheet.getCTWorksheet().getColsArray(0);
assertEquals(2, cols.sizeOfColArray());
- CTCol[] colArray = cols.getColArray();
+ CTCol[] colArray = cols.getColList().toArray(new CTCol[2]);
assertNotNull(colArray);
assertEquals(2 + 1, colArray[0].getMin()); // 1 based
assertEquals(7 + 1, colArray[0].getMax()); // 1 based
sheet.groupColumn(1, 2);
cols = sheet.getCTWorksheet().getColsArray(0);
assertEquals(4, cols.sizeOfColArray());
- colArray = cols.getColArray();
+ colArray = cols.getColList().toArray(new CTCol[0]);
assertEquals(2, colArray[1].getOutlineLevel());
//three level
sheet.groupColumn(2, 3);
cols = sheet.getCTWorksheet().getColsArray(0);
assertEquals(7, cols.sizeOfColArray());
- colArray = cols.getColArray();
+ colArray = cols.getColList().toArray(new CTCol[0]);
assertEquals(3, colArray[1].getOutlineLevel());
assertEquals(3, sheet.getCTWorksheet().getSheetFormatPr().getOutlineLevelCol());
sheet.ungroupColumn(8, 10);
- colArray = cols.getColArray();
+ colArray = cols.getColList().toArray(new CTCol[0]);
//assertEquals(3, colArray[1].getOutlineLevel());
sheet.ungroupColumn(4, 6);
sheet.ungroupColumn(2, 2);
- colArray = cols.getColArray();
+ colArray = cols.getColList().toArray(new CTCol[0]);
assertEquals(4, colArray.length);
assertEquals(2, sheet.getCTWorksheet().getSheetFormatPr().getOutlineLevelCol());
}
XSSFSheet xs = sheet;
CTWorksheet cts = xs.getCTWorksheet();
- CTCols[] cols_s = cts.getColsArray();
+ CTCols[] cols_s = cts.getColsList().toArray(new CTCols[1]);
assertEquals(1, cols_s.length);
CTCols cols = cols_s[0];
assertEquals(1, cols.sizeOfColArray());
// Now set another
sheet.setColumnWidth(3, 33 * 256);
- cols_s = cts.getColsArray();
+ cols_s = cts.getColsList().toArray(new CTCols[1]);
assertEquals(1, cols_s.length);
cols = cols_s[0];
assertEquals(2, cols.sizeOfColArray());
row3.createCell(5);
- CTRow[] xrow = sheetData.getRowArray();
+ CTRow[] xrow = sheetData.getRowList().toArray(new CTRow[3]);
assertEquals(3, xrow.length);
//rows are unsorted: {2, 1, 0}
assertEquals(1, xrow[2].getR());
assertTrue(xrow[2].equals(row3.getCTRow()));
- CTCell[] xcell = xrow[2].getCArray();
+ CTCell[] xcell = xrow[2].getCList().toArray(new CTCell[4]);
assertEquals("D1", xcell[0].getR());
assertEquals("A1", xcell[1].getR());
assertEquals("C1", xcell[2].getR());
workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook);
sheet = workbook.getSheetAt(0);
wsh = sheet.getCTWorksheet();
- xrow = sheetData.getRowArray();
+ xrow = sheetData.getRowList().toArray(new CTRow[3]);
assertEquals(3, xrow.length);
//rows are sorted: {0, 1, 2}
assertEquals(4, xrow[0].sizeOfCArray());
assertEquals(1, xrow[0].getR());
//cells are now sorted
- xcell = xrow[0].getCArray();
+ xcell = xrow[0].getCList().toArray(new CTCell[4]);
assertEquals("A1", xcell[0].getR());
assertEquals("C1", xcell[1].getR());
assertEquals("D1", xcell[2].getR());
helper.addCleanColIntoCols(cols1, col9);
// TODO - assert something interesting
- CTCol[] colArray = cols1.getColArray();
- assertEquals(12, colArray.length);
- assertEquals(1, colArray[0].getMin());
- assertEquals(16750, colArray[11].getMax());
+ assertEquals(12, cols1.getColList().size());
+ assertEquals(1, cols1.getColArray(0).getMin());
+ assertEquals(16750, cols1.getColArray(11).getMax());
}
public void testGetColumn() {
assertEquals(1, ps.size());
XWPFParagraph p = ps.get(0);
- assertEquals(5, p.getCTP().getRArray().length);
+ assertEquals(5, p.getCTP().getRList().size());
assertEquals("First header column!\tMid header\tRight header!", p
.getText());
}
run.addCarriageReturn();
run.setText("T2");
run.addCarriageReturn();
- assertEquals(3, run.getCTR().getCrArray().length);
+ assertEquals(3, run.getCTR().getCrList().size());
}