*
* @return next property id starting with 2
*/
- @SuppressWarnings("deprecation")
- protected int nextPid(){
+ protected int nextPid() {
int propid = 1;
for(CTProperty p : props.getProperties().getPropertyArray()){
if(p.getPid() > propid) propid = p.getPid();
* @param name the name to check
* @return whether a property with the given name exists in the custom properties
*/
- @SuppressWarnings("deprecation")
public boolean contains(String name) {
for(CTProperty p : props.getProperties().getPropertyArray()){
if(p.getName().equals(name)) return true;
*
* @param name the name of the property to fetch
*/
- @SuppressWarnings("deprecation")
public CTProperty getProperty(String name) {
for(CTProperty p : props.getProperties().getPropertyArray()){
if(p.getName().equals(name)) {
* @param notesText Should we retrieve text from notes?
* @param masterText Should we retrieve text from master slides?
*/
- @SuppressWarnings("deprecation")
public String getText(boolean slideText, boolean notesText, boolean masterText) {
StringBuffer text = new StringBuffer();
this.table = table;
}
- @SuppressWarnings("deprecation")
public DrawingTableRow[] getRows() {
CTTableRow[] ctTableRows = table.getTrArray();
DrawingTableRow[] o = new DrawingTableRow[ctTableRows.length];
this.row = row;
}
- @SuppressWarnings("deprecation")
public DrawingTableCell[] getCells() {
CTTableCell[] ctTableCells = row.getTcArray();
DrawingTableCell[] o = new DrawingTableCell[ctTableCells.length];
this.textBody = textBody;
}
- @SuppressWarnings("deprecation")
public DrawingParagraph[] getParagraphs() {
CTTextParagraph[] paragraphs = textBody.getPArray();
DrawingParagraph[] o = new DrawingParagraph[paragraphs.length];
* @param layout
* @return created slide
*/
- @SuppressWarnings("deprecation")
public XSLFSlide createSlide(XSLFSlideLayout layout) {
int slideNumber = 256, cnt = 1;
CTSlideIdList slideList;
*
* @param newIndex 0-based index of the slide
*/
- @SuppressWarnings("deprecation")
public void setSlideOrder(XSLFSlide slide, int newIndex){
int oldIndex = _slides.indexOf(slide);
if(oldIndex == -1) throw new IllegalArgumentException("Slide not found");
return _authors;
}
- @SuppressWarnings("deprecation")
public CTCommentAuthor getAuthorById(long id) {
// TODO Have a map
for (CTCommentAuthor author : _authors.getCmAuthorArray()) {
this.data = data;
}
- @SuppressWarnings("deprecation")
public List<DrawingTextBody> getDrawingText() {
CTGroupShape gs = data.getSpTree();
return paragraphs;
}
- @SuppressWarnings("deprecation")
private void processShape(CTGroupShape gs, List<DrawingTextBody> out) {
for (CTShape shape : gs.getSpArray()) {
CTTextBody ctTextBody = shape.getTxBody();
}\r
\r
@Override\r
- @SuppressWarnings("deprecation")\r
public GeneralPath getPath() {\r
GeneralPath path = new GeneralPath();\r
Rectangle2D bounds = getAnchor();\r
*/
private List<PackagePart> embedds;
- @SuppressWarnings("deprecation")
public XSLFSlideShow(OPCPackage container) throws OpenXML4JException, IOException, XmlException {
super(container);
private List<XSLFTableCell> _cells;\r
private XSLFTable _table;\r
\r
- @SuppressWarnings("deprecation")\r
/*package*/ XSLFTableRow(CTTableRow row, XSLFTable table){\r
_row = row;\r
_table = table;\r
super();
}
- @SuppressWarnings("deprecation")
public XSLFTableStyles(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);
return false;\r
}\r
\r
- @SuppressWarnings("deprecation")\r
void copy(XSLFTextParagraph other){\r
if (other == this) return;\r
\r
this(styles, strings, sheetContentsHandler, new DataFormatter(), formulasNotResults);
}
- @SuppressWarnings("deprecation")
private void init() {
if (commentsTable != null) {
commentCellRefs = new LinkedList<CellAddress>();
* @param sheetId the sheet Id of a sheet the formula belongs to.
* @param ref A1 style reference to the cell containing the formula.
*/
- @SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated
public void removeItem(int sheetId, String ref){
//sheet Id of a sheet the cell belongs to
int id = -1;
}
public int findAuthor(String author) {
- @SuppressWarnings("deprecation")
String[] authorArray = comments.getAuthors().getAuthorArray();
for (int i = 0 ; i < authorArray.length; i++) {
if (authorArray[i].equals(author)) {
* Calls that use the commentRefs cache will perform in O(1)
* time rather than O(n) lookup time for List<CTComment> comments.
*/
- @SuppressWarnings("deprecation") //YK: getXYZArray) array accessors are deprecated in xmlbeans with JDK 1.5 support
private void prepareCTCommentCache() {
// Create the cache if needed
if(commentRefs == null) {
final String stringRef = cellRef.formatAsString();
CTCommentList lst = comments.getCommentList();
if(lst != null) {
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
CTComment[] commentArray = lst.getCommentArray();
for (int i = 0; i < commentArray.length; i++) {
CTComment comment = commentArray[i];
link.getExternalBook().setId(newRel.getId());
}
- @SuppressWarnings("deprecation")
public List<String> getSheetNames() {
CTExternalSheetName[] sheetNames =
link.getExternalBook().getSheetNames().getSheetNameArray();
return names;
}
- @SuppressWarnings("deprecation")
public List<Name> getDefinedNames() {
CTExternalDefinedName[] extNames =
link.getExternalBook().getDefinedNames().getDefinedNameArray();
readFrom(part.getInputStream());
}
- @SuppressWarnings("deprecation")
public void readFrom(InputStream is) throws IOException {
try {
MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
* @param schemaId the schema ID
* @return CTSchema by it's ID
*/
- @SuppressWarnings("deprecation")
public CTSchema getCTSchemaById(String schemaId){
CTSchema xmlSchema = null;
* @param is The input stream containing the XML document.
* @throws IOException if an error occurs while reading.
*/
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void readFrom(InputStream is) throws IOException {
try {
int cnt = 0;
*
* @return all the SimpleXmlCell contained in this SingleXmlCells element
*/
- @SuppressWarnings("deprecation")
public List<XSSFSingleXmlCell> getAllSimpleXmlCell(){
List<XSSFSingleXmlCell> list = new Vector<XSSFSingleXmlCell>();
* @param is The input stream containing the XML document.
* @throws IOException if an error occurs while reading.
*/
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
protected void readFrom(InputStream is) throws IOException {
try {
doc = StyleSheetDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
parseValueAxis();
}
- @SuppressWarnings("deprecation")
private void parseCategoryAxis() {
for (CTCatAx catAx : chart.getPlotArea().getCatAxArray()) {
axis.add(new XSSFCategoryAxis(this, catAx));
}
}
- @SuppressWarnings("deprecation")
private void parseValueAxis() {
for (CTValAx valAx : chart.getPlotArea().getValAxArray()) {
axis.add(new XSSFValueAxis(this, valAx));
}\r
}\r
\r
- @SuppressWarnings("deprecation")\r
public XSSFColor[] getColors() {\r
CTColor[] ctcols = _scale.getColorArray();\r
XSSFColor[] c = new XSSFColor[ctcols.length];\r
_scale.setColorArray(ctcols);\r
}\r
\r
- @SuppressWarnings("deprecation")\r
public XSSFConditionalFormattingThreshold[] getThresholds() {\r
CTCfvo[] cfvos = _scale.getCfvoArray();\r
XSSFConditionalFormattingThreshold[] t = \r
_iconset.setReverse(reversed);\r
}\r
\r
- @SuppressWarnings("deprecation")\r
public XSSFConditionalFormattingThreshold[] getThresholds() {\r
CTCfvo[] cfvos = _iconset.getCfvoArray();\r
XSSFConditionalFormattingThreshold[] t = \r
}
@Beta
- @SuppressWarnings("deprecation")
public List<Integer> getRowLabelColumns() {
if (pivotTableDefinition.getRowFields() != null) {
List<Integer> columnIndexes = new ArrayList<Integer>();
* it just text in the default style?
*/
public boolean hasFormatting() {
- @SuppressWarnings("deprecation")
CTRElt[] rs = st.getRArray();
if (rs == null || rs.length == 0) {
return false;
/**
* Returns the plain string representation.
*/
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public String getString() {
if(st.sizeOfRArray() == 0) {
return utfDecode(st.getT());
return st;
}
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
protected void setStylesTableReference(StylesTable tbl){
styles = tbl;
if(st.sizeOfRArray() > 0) {
while(sub.size() > 1) sub.remove(sub.lastKey());
}
- @SuppressWarnings("deprecation")
TreeMap<Integer, CTRPrElt> getFormatMap(CTRst entry){
int length = 0;
TreeMap<Integer, CTRPrElt> formats = new TreeMap<Integer, CTRPrElt>();
throw new IllegalArgumentException("Text length was " + text.length() +
" but the last format index was " + formats.lastKey());
}
- CTRst st = CTRst.Factory.newInstance();
+ CTRst stf = CTRst.Factory.newInstance();
int runStartIdx = 0;
for (Iterator<Integer> it = formats.keySet().iterator(); it.hasNext();) {
int runEndIdx = it.next();
- CTRElt run = st.addNewR();
+ CTRElt run = stf.addNewR();
String fragment = text.substring(runStartIdx, runEndIdx);
run.setT(fragment);
preserveSpaces(run.xgetT());
if(fmt != null) run.setRPr(fmt);
runStartIdx = runEndIdx;
}
- return st;
+ return stf;
}
private ThemesTable getThemesTable() {
* @param row the xml bean containing all cell definitions for this row.
* @param sheet the parent sheet.
*/
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
protected XSSFRow(CTRow row, XSSFSheet sheet) {
_row = row;
_sheet = sheet;
*
* @see org.apache.poi.xssf.usermodel.XSSFSheet#write(java.io.OutputStream) ()
*/
- @SuppressWarnings("deprecation")
protected void onDocumentWrite(){
// check if cells in the CTRow are ordered
boolean isOrdered = true;
hyperlinks = new ArrayList<XSSFHyperlink>();
}
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
private void initRows(CTWorksheet worksheetParam) {
_rows = new TreeMap<Integer, XSSFRow>();
tables = new TreeMap<String, XSSFTable>();
* Read hyperlink relations, link them with CTHyperlink beans in this worksheet
* and initialize the internal array of XSSFHyperlink objects
*/
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
private void initHyperlinks() {
hyperlinks = new ArrayList<XSSFHyperlink>();
return Collections.unmodifiableList(hyperlinks);
}
- @SuppressWarnings("deprecation")
private int[] getBreaks(CTPageBreak ctPageBreak) {
CTBreak[] brkArray = ctPageBreak.getBrkArray();
int[] breaks = new int[brkArray.length];
return breaks;
}
- @SuppressWarnings("deprecation")
private void removeBreak(int index, CTPageBreak ctPageBreak) {
int index1 = index + 1;
CTBreak[] brkArray = ctPageBreak.getBrkArray();
*
* @return the list of merged regions
*/
- @SuppressWarnings("deprecation")
@Override
public List<CellRangeAddress> getMergedRegions() {
List<CellRangeAddress> addresses = new ArrayList<CellRangeAddress>();
/**
* Do not leave the width attribute undefined (see #52186).
*/
- @SuppressWarnings("deprecation")
private void setColWidthAttribute(CTCols ctCols) {
for (CTCol col : ctCols.getColArray()) {
if (!col.isSetWidth()) {
return (short) outlineLevel;
}
-
- @SuppressWarnings("deprecation")
private short getMaxOutlineLevelCols() {
CTCols ctCols = worksheet.getColsArray(0);
int outlineLevel = 0;
*
* @param indices A set of the regions to unmerge
*/
- @SuppressWarnings("deprecation")
public void removeMergedRegions(Collection<Integer> indices) {
if (!worksheet.isSetMergeCells()) return;
}
- @SuppressWarnings("deprecation")
private void setColumn(int targetColumnIx, Integer style,
Integer level, Boolean hidden, Boolean collapsed) {
CTCols cols = worksheet.getColsArray(0);
* the col info index of the start of the outline group
* @return the column index of the last column in the outline group
*/
- @SuppressWarnings("deprecation")
private int setGroupHidden(int pIdx, int level, boolean hidden) {
CTCols cols = worksheet.getColsArray(0);
int idx = pIdx;
return col.getMax() == other_col.getMin() - 1;
}
- @SuppressWarnings("deprecation")
private int findStartOfColumnOutlineGroup(int pIdx) {
// Find the start of the group.
CTCols cols = worksheet.getColsArray(0);
return idx;
}
- @SuppressWarnings("deprecation")
private int findEndOfColumnOutlineGroup(int colInfoIndex) {
CTCols cols = worksheet.getColsArray(0);
// Find the end of the group.
return idx;
}
- @SuppressWarnings("deprecation")
private void expandColumn(int columnIndex) {
CTCols cols = worksheet.getColsArray(0);
CTCol col = columnHelper.getColumn(columnIndex, false);
Boolean.FALSE, Boolean.FALSE);
}
- @SuppressWarnings("deprecation")
private boolean isColumnGroupHiddenByParent(int idx) {
CTCols cols = worksheet.getColsArray(0);
// Look out outline details of end
return startHidden;
}
- @SuppressWarnings("deprecation")
private int findColInfoIdx(int columnValue, int fromColInfoIdx) {
CTCols cols = worksheet.getColsArray(0);
* @param idx
* @return a boolean represented if the column is collapsed
*/
- @SuppressWarnings("deprecation")
private boolean isColumnGroupCollapsed(int idx) {
CTCols cols = worksheet.getColsArray(0);
CTCol[] colArray = cols.getColArray();
* @param resetOriginalRowHeight whether to set the original row's height to the default
*/
@Override
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void shiftRows(int startRow, int endRow, final int n, boolean copyRowHeight, boolean resetOriginalRowHeight) {
XSSFVMLDrawing vml = getVMLDrawing(false);
* @param value <code>true</code> if this sheet is selected
*/
@Override
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void setSelected(boolean value) {
CTSheetViews views = getSheetTypeSheetViews();
for (CTSheetView view : views.getSheetViewArray()) {
return dataValidationHelper;
}
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public List<XSSFDataValidation> getDataValidations() {
List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>();
CTDataValidations dataValidations = this.worksheet.getDataValidations();
return rule;\r
}\r
\r
- @SuppressWarnings("deprecation")\r
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules) {\r
if (regions == null) {\r
throw new IllegalArgumentException("regions must not be null");\r
*
* @return the xpath of the table's root element
*/
- @SuppressWarnings("deprecation")
public String getCommonXpath() {
if (commonXPath == null) {
String[] commonTokens = {};
}
- @SuppressWarnings("deprecation")
public List<XSSFXmlColumnPr> getXmlColumnPrs() {
if (xmlColumnPr==null) {
* Headers <em>must</em> be in sync, otherwise Excel will display a
* "Found unreadable content" message on startup.
*/
- @SuppressWarnings("deprecation")
public void updateHeaders(){
XSSFSheet sheet = (XSSFSheet)getParent();
CellReference ref = getStartCellReference();
}
@Override
- @SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated
protected void onDocumentRead() throws IOException {
try {
WorkbookDocument doc = WorkbookDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS);
* 'Selected' sheet(s) is a distinct concept.
*/
@Override
- @SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void setActiveSheet(int index) {
validateSheetIndex(index);
* @param pos the position that we want to insert the sheet into (0 based)
*/
@Override
- @SuppressWarnings("deprecation")
public void setSheetOrder(String sheetname, int pos) {
int idx = getSheetIndex(sheetname);
sheets.add(pos, sheets.remove(idx));
}
}
- @SuppressWarnings("deprecation")
private void reprocessNamedRanges() {
namedRanges = new ArrayList<XSSFName>();
if(workbook.isSetDefinedNames()) {
* @param excludeSheetIdx the sheet to exclude from the check or -1 to include all sheets in the check.
* @return true if the sheet contains the name, false otherwise.
*/
- @SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated
private boolean containsSheet(String name, int excludeSheetIdx) {
CTSheet[] ctSheetArray = workbook.getSheets().getSheetArray();
cleanColumns();
}
- @SuppressWarnings("deprecation")
public void cleanColumns() {
TreeSet<CTCol> trackedCols = new TreeSet<CTCol>(CTColComparator.BY_MIN_MAX);
CTCols newCols = CTCols.Factory.newInstance();
return new long[] { col.getMin(), col.getMax() };
}
- @SuppressWarnings("deprecation")
public static void sortColumns(CTCols newCols) {
CTCol[] colArray = newCols.getColArray();
Arrays.sort(colArray, CTColComparator.BY_MIN_MAX);
// Fetching the array is quicker than working on the new style
// list, assuming we need to read many of them (which we often do),
// and assuming we're not making many changes (which we're not)
- @SuppressWarnings("deprecation")
CTCol[] colArray = cols.getColArray();
for (CTCol col : colArray) {
return columnExists1Based(cols, index+1);
}
- @SuppressWarnings("deprecation")
private boolean columnExists1Based(CTCols cols, long index1) {
for (CTCol col : cols.getColArray()) {
if (col.getMin() == index1) {
return -1;
}
- @SuppressWarnings("deprecation")
private boolean columnExists(CTCols cols, long min, long max) {
for (CTCol col : cols.getColArray()) {
if (col.getMin() == min && col.getMax() == max) {
return false;
}
- @SuppressWarnings("deprecation")
public int getIndexOfColumn(CTCols cols, CTCol searchCol) {
int i = 0;
for (CTCol col : cols.getColArray()) {
/**
* Updated named ranges
*/
+ @SuppressWarnings("resource")
public void updateNamedRanges(FormulaShifter shifter) {
XSSFWorkbook wb = sheet.getWorkbook();
XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);
/**
* Update formulas.
*/
+ @SuppressWarnings("resource")
public void updateFormulas(FormulaShifter shifter) {
//update formulas on the parent sheet
updateSheetFormulas(sheet, shifter);
* @return the shifted formula if the formula was changed,
* <code>null</code> if the formula wasn't modified
*/
+ @SuppressWarnings("resource")
private static String shiftFormula(XSSFRow row, String formula, FormulaShifter shifter) {
XSSFSheet sheet = row.getSheet();
XSSFWorkbook wb = sheet.getWorkbook();
}
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings("resource")
public void updateConditionalFormatting(FormulaShifter shifter) {
XSSFWorkbook wb = sheet.getWorkbook();
int sheetIndex = wb.getSheetIndex(sheet);
this(nextDecorator.paragraph, nextDecorator);
}
- @SuppressWarnings("deprecation")
public XWPFCommentsDecorator(XWPFParagraph paragraph, XWPFParagraphDecorator nextDecorator) {
super(paragraph, nextDecorator);
private final String tag;\r
private final IBody part;\r
\r
- @SuppressWarnings("deprecation")\r
public AbstractXWPFSDT(CTSdtPr pr, IBody part) {\r
\r
CTString[] aliases = pr.getAliasArray();\r
protected String author;
protected StringBuffer text;
- @SuppressWarnings("deprecation")
public XWPFComment(CTComment comment, XWPFDocument document) {
text = new StringBuffer();
id = comment.getId().toString();
}
}
- @SuppressWarnings("deprecation")
private void initFootnotes() throws XmlException, IOException {
for (POIXMLDocumentPart p : getRelations()) {
String relation = p.getPackageRelationship().getRelationshipType();
* @param table
*/
@Override
- @SuppressWarnings("deprecation")
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i = 0;
* @param table\r
* @see org.apache.poi.xwpf.usermodel.IBody#insertTable(int pos, XWPFTable table)\r
*/
- @SuppressWarnings("deprecation")
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);\r
int i = 0;\r
* Read document
*/\r
@Override\r
- @SuppressWarnings("deprecation")\r
protected void onDocumentRead() throws IOException {\r
FootnotesDocument notesDoc;\r
try {\r
* @param pos
* @param table
*/
- @SuppressWarnings("deprecation")
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i = 0;
/**
* checks whether specific LatentStyleID is a latentStyle\r
*/\r
- @SuppressWarnings("deprecation")\r
protected boolean isLatentStyle(String latentStyleID) {\r
for (CTLsdException lsd : latentStyles.getLsdExceptionArray()) {\r
if (lsd.getName().equals(latentStyleID)) {\r
* read numbering form an existing package\r
*/\r
@Override\r
- @SuppressWarnings("deprecation")\r
protected void onDocumentRead() throws IOException {\r
NumberingDocument numberingDoc = null;\r
InputStream is;\r
int beginRunPos = 0, candCharPos = 0;
boolean newList = false;
- @SuppressWarnings("deprecation")
CTR[] rArray = paragraph.getRArray();
for (int runPos = startRun; runPos < rArray.length; runPos++) {
int beginTextPos = 0, beginCharPos = 0, textPos = 0, charPos = 0;
*
* @param segment
*/
- @SuppressWarnings("deprecation")
public String getText(TextSegement segment) {
int runBegin = segment.getBeginRun();
int textBegin = segment.getBeginText();
* @param r the CTR bean which holds the run attributes\r
* @param p the parent paragraph\r
*/\r
- @SuppressWarnings("deprecation")
public XWPFRun(CTR r, IRunBody p) {
this.run = r;
this.parent = p;
*\r
* @param styles\r
*/\r
- @SuppressWarnings("deprecation")\r
public void setStyles(CTStyles styles) {
ctStyles = styles;\r
\r
}
}
- @SuppressWarnings("deprecation")
public XWPFTable(CTTbl table, IBody part) {
this.part = part;
this.ctTbl = table;
*\r
* @see org.apache.poi.xwpf.usermodel.IBody#insertTable(int, org.apache.poi.xwpf.usermodel.XWPFTable)\r
*/\r
- @SuppressWarnings("deprecation")\r
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i = 0;
*\r
* @return a list of {@link XWPFTableCell}\r
*/\r
- @SuppressWarnings("deprecation")\r
public List<XWPFTableCell> getTableCells() {\r
if (tableCells == null) {\r
List<XWPFTableCell> cells = new ArrayList<XWPFTableCell>();\r