summaryrefslogtreecommitdiffstats
path: root/src/ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-12-09 20:42:19 +0000
committerPJ Fanning <fanningpj@apache.org>2020-12-09 20:42:19 +0000
commitea56d752f4c93af19a136601e6e28926a95cfe4e (patch)
tree1cdbbbff3301efc6b4723d48b4e876da51978dcc /src/ooxml
parentea59cc2bc90b4ab8401217f469cde4d4ab63d789 (diff)
downloadpoi-ea56d752f4c93af19a136601e6e28926a95cfe4e.tar.gz
poi-ea56d752f4c93af19a136601e6e28926a95cfe4e.zip
remove more deprecated code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884269 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml')
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java13
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java24
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java15
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java2
4 files changed, 7 insertions, 47 deletions
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 592ff3a007..155aa70556 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
@@ -4070,19 +4070,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
}
/**
- * Creates a new Table, and associates it with this Sheet. The table does
- * not yet have an area defined and needs to be initialized by calling
- * {@link XSSFTable#setArea(AreaReference)}.
- *
- * @deprecated Use {@link #createTable(AreaReference))} instead
- */
- @Deprecated
- @Removal(version = "4.2.0")
- public XSSFTable createTable() {
- return createTable(null);
- }
-
- /**
* Creates a new Table, and associates it with this Sheet.
* <p>
* The table is assigned a default display name (since 4.1.1) which can be overridden
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
index 31b6e320cf..62f6158deb 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
@@ -220,18 +220,11 @@ public class XSSFTable extends POIXMLDocumentPart implements Table {
}
return tableColumns;
}
-
+
/**
- * Note this list is static - once read, it does not notice later changes to the underlying column structures
- * To clear the cache, call {@link #updateHeaders}
- *
- * @deprecated Use {@link XSSFTableColumn#getXmlColumnPr()} instead.
- *
- * @return List of XSSFXmlColumnPr
+ * Use {@link XSSFTableColumn#getXmlColumnPr()} instead.
*/
- @Deprecated
- @Removal(version="4.2.0")
- public List<XSSFXmlColumnPr> getXmlColumnPrs() {
+ private List<XSSFXmlColumnPr> getXmlColumnPrs() {
if (xmlColumnPrs == null) {
xmlColumnPrs = new ArrayList<>();
for (XSSFTableColumn column: getColumns()) {
@@ -439,17 +432,6 @@ public class XSSFTable extends POIXMLDocumentPart implements Table {
}
/**
- * @deprecated Use {@link #getColumnCount()} instead.
- *
- * @return the number of mapped table columns (see Open Office XML Part 4: chapter 3.5.1.4)
- */
- @Deprecated
- @Removal(version = "4.2.0")
- public long getNumberOfMappedColumns() {
- return ctTable.getTableColumns().getCount();
- }
-
- /**
* Get the area reference for the cells which this table covers. The area
* includes header rows and totals rows.
*
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java
index 733da646f9..45f08f8f0f 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java
@@ -89,7 +89,7 @@ public final class TestXSSFTable {
XSSFSheet sheet = outputWorkbook.createSheet();
//Create
- XSSFTable outputTable = sheet.createTable();
+ XSSFTable outputTable = sheet.createTable(null);
outputTable.setDisplayName("Test");
CTTable outputCTTable = outputTable.getCTTable();
@@ -224,15 +224,6 @@ public final class TestXSSFTable {
}
@Test
- public void getNumberOfMappedColumns() throws IOException {
- try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
- XSSFTable table = wb.getTable("\\_Prime.1");
- //noinspection deprecation
- assertEquals(3, table.getNumberOfMappedColumns());
- }
- }
-
- @Test
public void getColumnCount() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
XSSFTable table = wb.getTable("\\_Prime.1");
@@ -258,7 +249,7 @@ public final class TestXSSFTable {
// can be synchronized with the underlying CTTable
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sh = wb.createSheet();
- XSSFTable table = sh.createTable();
+ XSSFTable table = sh.createTable(null);
assertNotNull(table.getDisplayName());
assertNotNull(table.getCTTable().getDisplayName());
CTTable ctTable = table.getCTTable();
@@ -289,7 +280,7 @@ public final class TestXSSFTable {
public void getRowCount() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sh = wb.createSheet();
- XSSFTable table = sh.createTable();
+ XSSFTable table = sh.createTable(null);
CTTable ctTable = table.getCTTable();
assertEquals(0, table.getRowCount());
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
index e2b2d88d5e..c13d96bc2d 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
@@ -1102,7 +1102,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
// If a table is added after getTable is called it should still be reachable by XSSFWorkbook.getTable
// This test makes sure that if any caching is done that getTable never uses a stale cache
- XSSFTable table2 = wb.getSheet("Foglio2").createTable();
+ XSSFTable table2 = wb.getSheet("Foglio2").createTable(null);
table2.setName("Table2");
assertSame("Did not find Table2", table2, wb.getTable("Table2"));