diff options
author | Javen O'Neal <onealj@apache.org> | 2016-07-04 10:15:18 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2016-07-04 10:15:18 +0000 |
commit | 8d31c01f4035aaa40467d96fe1de1f88ed801cf8 (patch) | |
tree | 41f1ce223e92a49154a096a3e5f0c5d55a174975 /src/ooxml/java/org | |
parent | fb8c79d96c2f0ddffb13f5b96c0f65b66c77ce5f (diff) | |
download | poi-8d31c01f4035aaa40467d96fe1de1f88ed801cf8.tar.gz poi-8d31c01f4035aaa40467d96fe1de1f88ed801cf8.zip |
bug 59791: replace deprecated Cell.CELL_TYPE_* usage with CellType.*
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1751240 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org')
6 files changed, 12 insertions, 27 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java index 3415af3010..965534f34b 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java @@ -22,6 +22,7 @@ import org.apache.poi.ss.formula.IStabilityClassifier; import org.apache.poi.ss.formula.WorkbookEvaluator; import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.POILogFactory; @@ -120,7 +121,7 @@ public final class SXSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator { // Evaluate what we have for (Row r : sheet) { for (Cell c : r) { - if (c.getCellType() == Cell.CELL_TYPE_FORMULA) { + if (c.getCellType() == CellType.FORMULA) { eval.evaluateFormulaCell(c); } } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java index 81359d3857..6d337f4465 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java @@ -110,7 +110,7 @@ public abstract class BaseXSSFFormulaEvaluator implements FormulaEvaluator, Work * and the result. If you want the cell replaced with * the result of the formula, use {@link #evaluate(org.apache.poi.ss.usermodel.Cell)} } * @param cell The cell to evaluate - * @return The type of the formula result (the cell's type remains as HSSFCell.CELL_TYPE_FORMULA however) + * @return The type of the formula result (the cell's type remains as CellType.FORMULA however) */ public CellType evaluateFormulaCell(Cell cell) { if (cell == null || cell.getCellType() != CellType.FORMULA) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotCacheDefinition.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotCacheDefinition.java index c611e13e38..8ab465aff1 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotCacheDefinition.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotCacheDefinition.java @@ -29,6 +29,7 @@ import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.util.AreaReference; @@ -143,7 +144,7 @@ public class XSSFPivotCacheDefinition extends POIXMLDocumentPart{ //General number format cf.setNumFmtId(0); Cell cell = row.getCell(i); - cell.setCellType(Cell.CELL_TYPE_STRING); + cell.setCellType(CellType.STRING); cf.setName(row.getCell(i).getStringCellValue()); cf.addNewSharedItems(); } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java index d0e9d1a8ce..9f68649199 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPivotTable.java @@ -31,6 +31,7 @@ import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.DataConsolidateFunction; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.util.AreaReference; @@ -39,26 +40,7 @@ import org.apache.poi.util.Beta; import org.apache.poi.util.Internal; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlOptions; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCacheSource; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColFields; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDataField; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDataFields; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTField; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTItems; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTLocation; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageField; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageFields; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCacheDefinition; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotField; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotFields; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableStyle; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRowFields; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheetSource; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.STAxis; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataConsolidateFunction; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.STItemType; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.STSourceType; +import org.openxmlformats.schemas.spreadsheetml.x2006.main.*; public class XSSFPivotTable extends POIXMLDocumentPart { @@ -357,7 +339,7 @@ public class XSSFPivotTable extends POIXMLDocumentPart { dataField.setSubtotal(STDataConsolidateFunction.Enum.forInt(function.getValue())); Cell cell = getDataSheet().getRow(pivotArea.getFirstCell().getRow()) .getCell(pivotArea.getFirstCell().getCol() + columnIndex); - cell.setCellType(Cell.CELL_TYPE_STRING); + cell.setCellType(CellType.STRING); dataField.setName(valueFieldName); dataField.setFld(columnIndex); dataFields.setCount(dataFields.sizeOfDataFieldArray()); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 3ae3d5b579..efd45943fa 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -43,7 +43,6 @@ import javax.xml.namespace.QName; import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.POIXMLException; - import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException; import org.apache.poi.openxml4j.opc.PackagePart; @@ -58,6 +57,7 @@ import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellCopyPolicy; import org.apache.poi.ss.usermodel.CellRange; import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.DataValidation; import org.apache.poi.ss.usermodel.DataValidationHelper; import org.apache.poi.ss.usermodel.Footer; @@ -3782,7 +3782,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { arrayFormulas.remove(range); CellRange<XSSFCell> cr = getCellRange(range); for (XSSFCell c : cr) { - c.setCellType(Cell.CELL_TYPE_BLANK); + c.setCellType(CellType.BLANK); } return cr; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java index 99e8a1e408..107e205b98 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java @@ -26,6 +26,7 @@ import org.apache.poi.ss.formula.ptg.Ptg; import org.apache.poi.ss.formula.ptg.Pxg; import org.apache.poi.ss.formula.ptg.Pxg3D; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.usermodel.XSSFCell; @@ -76,7 +77,7 @@ public final class XSSFFormulaUtils { for (Sheet sh : _wb) { for (Row row : sh) { for (Cell cell : row) { - if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) { + if (cell.getCellType() == CellType.FORMULA) { updateFormula((XSSFCell) cell, oldName, newName); } } |