This is an automated email from the ASF dual-hosted git repository. centic pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/poi.git
commit 59e595b8443c2016cf3b3eacc838c92601eb4273 Author: Dominik Stadler <[email protected]> AuthorDate: Sun Nov 16 20:43:25 2025 +0100 Remove some of the deprecated methods with @Removal("6.0.0") We announced their removal for 6.0.0, so we can remove them now as we plan a 6.0.0 release next. Some were not yet removed as they have still internal usage or seem to need more work to finally remove. --- .../org/apache/poi/ooxml/util/PackageHelper.java | 46 ------------- .../java/org/apache/poi/ooxml/util/SAXHelper.java | 41 ----------- .../apache/poi/ooxml/util/TransformerHelper.java | 36 ---------- .../org/apache/poi/xssf/model/CommentsTable.java | 23 +------ .../poi/xssf/streaming/GZIPSheetDataWriter.java | 8 +-- .../apache/poi/xssf/streaming/SXSSFWorkbook.java | 8 --- .../apache/poi/xssf/streaming/SheetDataWriter.java | 10 +-- .../poi/xssf/streaming/StreamingSheetWriter.java | 12 +--- .../apache/poi/xssf/usermodel/XSSFCellStyle.java | 20 +----- .../org/apache/poi/xssf/usermodel/XSSFFont.java | 32 --------- .../apache/poi/xssf/usermodel/XSSFWorkbook.java | 7 -- .../poi/xwpf/usermodel/XWPFDefaultRunStyle.java | 17 +---- .../apache/poi/xssf/usermodel/TestXSSFFont.java | 40 ++++++----- .../poi/xssf/usermodel/TestXSSFWorkbook.java | 4 +- .../org/apache/poi/hslf/record/DocumentAtom.java | 12 +--- .../org/apache/poi/hslf/usermodel/HSLFSlide.java | 20 ------ .../apache/poi/hssf/usermodel/HSSFCellStyle.java | 14 ---- .../org/apache/poi/hssf/usermodel/HSSFFont.java | 8 --- .../apache/poi/hssf/usermodel/HSSFWorkbook.java | 7 -- .../java/org/apache/poi/sl/usermodel/Slide.java | 19 ----- .../org/apache/poi/ss/formula/atp/DateParser.java | 29 -------- .../ss/formula/functions/Fixed0ArgFunction.java | 38 ---------- .../poi/ss/formula/functions/Function0Arg.java | 35 ---------- .../org/apache/poi/ss/usermodel/CellStyle.java | 44 +++++------- .../java/org/apache/poi/ss/usermodel/Font.java | 15 ---- .../org/apache/poi/ss/usermodel/FontCharset.java | 80 ---------------------- .../java/org/apache/poi/ss/usermodel/Workbook.java | 11 --- .../main/java/org/apache/poi/util/StaxHelper.java | 56 --------------- 28 files changed, 51 insertions(+), 641 deletions(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/PackageHelper.java b/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/PackageHelper.java index a7b7f8c1e5..e52169e224 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/PackageHelper.java +++ b/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/PackageHelper.java @@ -32,12 +32,10 @@ import org.apache.poi.openxml4j.opc.PackagePartName; import org.apache.poi.openxml4j.opc.PackageProperties; import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.openxml4j.opc.PackageRelationshipCollection; -import org.apache.poi.openxml4j.opc.PackageRelationshipTypes; import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.internal.InvalidZipException; import org.apache.poi.util.IOUtils; -import org.apache.poi.util.Removal; /** * Provides handy methods to work with OOXML packages @@ -78,50 +76,6 @@ public final class PackageHelper { } } - /** - * Clone the specified package. - * - * @param pkg the package to clone - * @param file the destination file - * @return the cloned package - * @deprecated this method is not used internally and creates temp files that are not well handled - */ - @Deprecated - @Removal(version = "6.0.0") - public static OPCPackage clone(OPCPackage pkg, File file) throws OpenXML4JException, IOException { - - String path = file.getAbsolutePath(); - - try (OPCPackage dest = OPCPackage.create(path)) { - PackageRelationshipCollection rels = pkg.getRelationships(); - for (PackageRelationship rel : rels) { - PackagePart part = pkg.getPart(rel); - PackagePart part_tgt; - if (rel.getRelationshipType().equals(PackageRelationshipTypes.CORE_PROPERTIES)) { - copyProperties(pkg.getPackageProperties(), dest.getPackageProperties()); - continue; - } - dest.addRelationship(part.getPartName(), rel.getTargetMode(), rel.getRelationshipType()); - part_tgt = dest.createPart(part.getPartName(), part.getContentType()); - - try ( - InputStream in = part.getInputStream(); - OutputStream out = part_tgt.getOutputStream() - ) { - IOUtils.copy(in, out); - } - - if (part.hasRelationships()) { - copy(pkg, part, dest, part_tgt); - } - } - } - - //the temp file will be deleted when JVM terminates - new File(path).deleteOnExit(); - return OPCPackage.open(path); - } - /** * Recursively copy package parts to the destination package */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/SAXHelper.java b/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/SAXHelper.java deleted file mode 100644 index 1d6b7e515d..0000000000 --- a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/SAXHelper.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.ooxml.util; - -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.poi.util.Removal; -import org.apache.poi.util.XMLHelper; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; - - -/** - * Provides handy methods for working with SAX parsers and readers - * @deprecated use {@link XMLHelper} - */ -@Deprecated -@Removal(version = "6.0.0") -public final class SAXHelper { - /** - * Creates a new SAX XMLReader, with sensible defaults - */ - public static XMLReader newXMLReader() throws SAXException, ParserConfigurationException { - return XMLHelper.newXMLReader(); - } -} diff --git a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/TransformerHelper.java b/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/TransformerHelper.java deleted file mode 100644 index c3f00bd034..0000000000 --- a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/TransformerHelper.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.ooxml.util; - -import javax.xml.transform.TransformerFactory; - -import org.apache.poi.util.Removal; -import org.apache.poi.util.XMLHelper; - -/** - * @deprecated use {@link XMLHelper} - */ -@Removal(version = "6.0.0") -@Deprecated -public final class TransformerHelper { - private TransformerHelper() {} - - public static TransformerFactory getFactory() { - return XMLHelper.getTransformerFactory(); - } -} diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java index 2cd4d494a6..46c895e415 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CommentsTable.java @@ -32,7 +32,6 @@ import org.apache.poi.ss.usermodel.ClientAnchor; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.util.CellAddress; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; import org.apache.poi.util.Units; import org.apache.poi.xssf.usermodel.OoxmlSheetExtensions; import org.apache.poi.xssf.usermodel.XSSFClientAnchor; @@ -80,7 +79,7 @@ public class CommentsTable extends POIXMLDocumentPart implements Comments { readFrom(stream); } } - + public void readFrom(InputStream is) throws IOException { try { CommentsDocument doc = CommentsDocument.Factory.parse(is, DEFAULT_XML_OPTIONS); @@ -110,22 +109,6 @@ public class CommentsTable extends POIXMLDocumentPart implements Comments { } } - /** - * Called after the reference is updated, so that - * we can reflect that in our cache - * @param oldReference the comment to remove from the commentRefs map - * @param comment the comment to replace in the commentRefs map - * @deprecated use {@link #referenceUpdated(CellAddress, XSSFComment)} - */ - @Deprecated - @Removal(version = "6.0.0") - public void referenceUpdated(CellAddress oldReference, CTComment comment) { - if(commentRefs != null) { - commentRefs.remove(oldReference); - commentRefs.put(new CellAddress(comment.getRef()), comment); - } - } - /** * Called after the reference is updated, so that * we can reflect that in our cache @@ -254,7 +237,7 @@ public class CommentsTable extends POIXMLDocumentPart implements Comments { return new XSSFComment(this, newComment(ref), vmlShape); } - + /** * Create a new comment located at cell address * @@ -266,7 +249,7 @@ public class CommentsTable extends POIXMLDocumentPart implements Comments { CTComment ct = comments.getCommentList().addNewComment(); ct.setRef(ref.formatAsString()); ct.setAuthorId(DEFAULT_AUTHOR_ID); - + if(commentRefs != null) { commentRefs.put(ref, ct); } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java index c1a4594c22..6f78bc6ca5 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java @@ -28,7 +28,6 @@ import java.io.OutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; -import org.apache.poi.util.Removal; import org.apache.poi.util.TempFile; import org.apache.poi.xssf.model.SharedStringsTable; @@ -40,7 +39,7 @@ public class GZIPSheetDataWriter extends SheetDataWriter { public GZIPSheetDataWriter() throws IOException { super(); } - + /** * @param sharedStringsTable the shared strings table, or null if inline text is used */ @@ -50,12 +49,9 @@ public class GZIPSheetDataWriter extends SheetDataWriter { /** * @return temp file to write sheet data - * @deprecated no need for this be public, will be made private or protected in an upcoming release */ @Override - @Deprecated - @Removal(version = "6.0.0") - public File createTempFile() throws IOException { + protected File createTempFile() throws IOException { return TempFile.createTempFile("poi-sxssf-sheet-xml", ".gz"); } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java index aac908d299..1730e46443 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java @@ -67,7 +67,6 @@ import org.apache.poi.util.Beta; import org.apache.poi.util.IOUtils; import org.apache.poi.util.Internal; import org.apache.poi.util.NotImplemented; -import org.apache.poi.util.Removal; import org.apache.poi.util.TempFile; import org.apache.poi.xssf.model.SharedStringsTable; import org.apache.poi.xssf.usermodel.XSSFChartSheet; @@ -866,13 +865,6 @@ public class SXSSFWorkbook implements Workbook { return _wb.getNumberOfFonts(); } - @Override - @Deprecated - @Removal(version = "6.0.0") - public int getNumberOfFontsAsInt() { - return getNumberOfFonts(); - } - @Override public Font getFontAt(int idx) { return _wb.getFontAt(idx); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java index dcd8294271..77ed527f54 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/SheetDataWriter.java @@ -40,7 +40,6 @@ import org.apache.poi.ss.usermodel.FormulaError; import org.apache.poi.ss.usermodel.RichTextString; import org.apache.poi.ss.util.CellReference; import org.apache.poi.util.CodepointsUtil; -import org.apache.poi.util.Removal; import org.apache.poi.util.TempFile; import org.apache.poi.xssf.model.SharedStringsTable; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellType; @@ -89,11 +88,8 @@ public class SheetDataWriter implements Closeable { * it and specify a different temp directory or filename or suffix, e.g. <code>.gz</code> * * @return temp file to write sheet data - * @deprecated use {@link TempFile#createTempFile(String, String)} directly */ - @Removal(version = "6.0.0") - //make this protected or private in POI 6.0.0 - no need for this to be public - public File createTempFile() throws IOException { + protected File createTempFile() throws IOException { return TempFile.createTempFile("poi-sxssf-sheet", ".xml"); } @@ -101,11 +97,9 @@ public class SheetDataWriter implements Closeable { * Create a writer for the sheet data. * * @param fd the file to write to - * @deprecated this method is due to be made non-public, probably protected */ - @Removal(version = "6.0.0") //make this protected or private in POI 6.0.0 - no need for this to be public - public Writer createWriter(File fd) throws IOException { + protected Writer createWriter(File fd) throws IOException { FileOutputStream fos = new FileOutputStream(fd); OutputStream decorated; try { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/StreamingSheetWriter.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/StreamingSheetWriter.java index 1398c57abc..a1e534d8fb 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/StreamingSheetWriter.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/StreamingSheetWriter.java @@ -29,7 +29,6 @@ import java.nio.charset.StandardCharsets; import org.apache.logging.log4j.Logger; import org.apache.poi.logging.PoiLogManager; import org.apache.poi.util.Beta; -import org.apache.poi.util.Removal; /** * Unlike SheetDataWriter, this writer does not create a temporary file, it writes data directly @@ -41,15 +40,6 @@ public class StreamingSheetWriter extends SheetDataWriter { private static final Logger LOG = PoiLogManager.getLogger(StreamingSheetWriter.class); private boolean closed = false; - /** - * @throws IOException always thrown, use the constructor with an OutputStream - * @deprecated use {@link #StreamingSheetWriter(OutputStream)} - */ - @Removal(version = "6.0.0") - public StreamingSheetWriter() throws IOException { - throw new IllegalStateException("StreamingSheetWriter requires OutputStream"); - } - public StreamingSheetWriter(OutputStream out) throws IOException { super(createWriter(out)); LOG.atDebug().log("Preparing SXSSF sheet writer"); @@ -67,7 +57,7 @@ public class StreamingSheetWriter extends SheetDataWriter { * @throws IllegalStateException always thrown - not supported */ @Override - public Writer createWriter(File fd) throws IOException { + protected Writer createWriter(File fd) throws IOException { throw new IllegalStateException("Not supported with StreamingSheetWriter"); } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java index 44e12035e6..bbabd6ebb7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java @@ -34,7 +34,6 @@ import org.apache.poi.ss.usermodel.ReadingOrder; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.util.CellUtil; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; import org.apache.poi.xssf.model.StylesTable; import org.apache.poi.xssf.model.ThemesTable; import org.apache.poi.xssf.usermodel.extensions.XSSFCellAlignment; @@ -455,21 +454,6 @@ public class XSSFCellStyle implements CellStyle, Duplicatable { return getFontId(); } - /** - * Gets the index of the font for this style - * - * @return font index - * @see org.apache.poi.xssf.usermodel.XSSFWorkbook#getFontAt(int) - * @deprecated use {@link #getFontIndex()} instead - * @since 4.0.0 - */ - @Deprecated - @Removal(version = "6.0.0") - @Override - public int getFontIndexAsInt() { - return getFontId(); - } - /** * Get whether the cell's using this style are to be hidden * @@ -858,7 +842,7 @@ public class XSSFCellStyle implements CellStyle, Duplicatable { throw new IllegalArgumentException("XSSFCellStyle only accepts XSSFColor instances"); } } - + /** * Set the background fill color represented as an indexed color value. * <p> @@ -913,7 +897,7 @@ public class XSSFCellStyle implements CellStyle, Duplicatable { addFill(ct); invalidateCachedProperties(); } - + /** * Set the foreground fill color represented as a {@link org.apache.poi.ss.usermodel.Color} value. * <br> diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java index 41e903907b..e4ba7e0bbd 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java @@ -26,7 +26,6 @@ import org.apache.poi.ss.usermodel.FontScheme; import org.apache.poi.ss.usermodel.FontUnderline; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; import org.apache.poi.xssf.model.StylesTable; import org.apache.poi.xssf.model.ThemesTable; import org.openxmlformats.schemas.officeDocument.x2006.sharedTypes.STVerticalAlignRun; @@ -346,25 +345,6 @@ public class XSSFFont implements Font { } } - /** - * set character-set to use. - * - * @deprecated use {@link #setCharSet(FontCharset)} instead - */ - @Deprecated - @Removal(version = "6.0.0") - public void setCharSet(org.apache.poi.ss.usermodel.FontCharset charSet) { - CTIntProperty charsetProperty; - if(_ctFont.sizeOfCharsetArray() == 0) { - charsetProperty = _ctFont.addNewCharset(); - } else { - charsetProperty = _ctFont.getCharsetArray(0); - } - // We know that FontCharset only has valid entries in it, - // so we can just set the int value from it - charsetProperty.setVal( charSet.getValue() ); - } - /** * set character-set to use. * @@ -659,18 +639,6 @@ public class XSSFFont implements Font { return _index; } - /** - * @return index - * @deprecated use {@link #getIndex()} instead - */ - @Deprecated - @Removal(version = "6.0.0") - @Override - public int getIndexAsInt() - { - return _index; - } - public int hashCode(){ return _ctFont.toString().hashCode(); } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index 2565b12b9a..b1c63c6a98 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -1172,13 +1172,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su return stylesSource.getFonts().size(); } - @Override - @Deprecated - @Removal(version = "6.0.0") - public int getNumberOfFontsAsInt() { - return getNumberOfFonts(); - } - /** * Get the number of named ranges in the this workbook * diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java index 4595ff65cd..1bc06147e9 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java @@ -21,7 +21,6 @@ import java.math.BigDecimal; import java.math.RoundingMode; import org.apache.poi.ooxml.util.POIXMLUnits; -import org.apache.poi.util.Removal; import org.apache.poi.util.Units; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr; @@ -30,7 +29,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr; * TODO Share logic with {@link XWPFRun} which also uses CTRPr */ public class XWPFDefaultRunStyle { - private CTRPr rpr; + private final CTRPr rpr; public XWPFDefaultRunStyle(CTRPr rpr) { this.rpr = rpr; @@ -45,20 +44,6 @@ public class XWPFDefaultRunStyle { return rpr; } - /** - * Specifies the font size. - * - * @return value representing the font size (non-integer size will be rounded with half rounding up, - * -1 is returned if size not set) - * @deprecated use {@link #getFontSizeAsDouble()} - */ - @Deprecated - @Removal(version = "6.0.0") - public int getFontSize() { - BigDecimal bd = getFontSizeAsBigDecimal(0); - return bd == null ? -1 : bd.intValue(); - } - /** * Specifies the font size. * diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFont.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFont.java index 6c62954cc7..8eb5a7964f 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFont.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFFont.java @@ -17,7 +17,10 @@ package org.apache.poi.xssf.usermodel; -import static org.apache.poi.ss.usermodel.FontCharset.*; +import static org.apache.poi.common.usermodel.fonts.FontCharset.ANSI; +import static org.apache.poi.common.usermodel.fonts.FontCharset.ARABIC; +import static org.apache.poi.common.usermodel.fonts.FontCharset.DEFAULT; +import static org.apache.poi.common.usermodel.fonts.FontCharset.RUSSIAN; import static org.junit.jupiter.api.Assertions.*; import java.awt.Color; @@ -88,32 +91,31 @@ public final class TestXSSFFont extends BaseTestFont { assertTrue(ctFont.getBArray(0).getVal()); } - @SuppressWarnings("deprecation") @Test void testCharSetWithDeprecatedFontCharset() throws IOException { CTFont ctFont=CTFont.Factory.newInstance(); CTIntProperty prop=ctFont.addNewCharset(); - prop.setVal(ANSI.getValue()); + prop.setVal(ANSI.getNativeId()); ctFont.setCharsetArray(0,prop); XSSFFont xssfFont=new XSSFFont(ctFont); assertEquals(Font.ANSI_CHARSET,xssfFont.getCharSet()); xssfFont.setCharSet(DEFAULT); - assertEquals(DEFAULT.getValue(),ctFont.getCharsetArray(0).getVal()); + assertEquals(DEFAULT.getNativeId(),ctFont.getCharsetArray(0).getVal()); // Try with a few less usual ones: // Set with the Charset itself xssfFont.setCharSet(RUSSIAN); - assertEquals(RUSSIAN.getValue(), xssfFont.getCharSet()); + assertEquals(RUSSIAN.getNativeId(), xssfFont.getCharSet()); // And set with the Charset index - xssfFont.setCharSet(ARABIC.getValue()); - assertEquals(ARABIC.getValue(), xssfFont.getCharSet()); - xssfFont.setCharSet((byte)(ARABIC.getValue())); - assertEquals(ARABIC.getValue(), xssfFont.getCharSet()); + xssfFont.setCharSet(ARABIC.getNativeId()); + assertEquals(ARABIC.getNativeId(), xssfFont.getCharSet()); + xssfFont.setCharSet((byte)(ARABIC.getNativeId())); + assertEquals(ARABIC.getNativeId(), xssfFont.getCharSet()); // This one isn't allowed - assertNull(valueOf(9999)); + assertNull(FontCharset.valueOf(9999)); assertThrows(POIXMLException.class, () -> xssfFont.setCharSet(9999), "Shouldn't be able to set an invalid charset"); @@ -138,24 +140,24 @@ public final class TestXSSFFont extends BaseTestFont { void testCharSet() throws IOException { CTFont ctFont=CTFont.Factory.newInstance(); CTIntProperty prop=ctFont.addNewCharset(); - prop.setVal(FontCharset.ANSI.getNativeId()); + prop.setVal(ANSI.getNativeId()); ctFont.setCharsetArray(0,prop); XSSFFont xssfFont=new XSSFFont(ctFont); assertEquals(Font.ANSI_CHARSET,xssfFont.getCharSet()); - xssfFont.setCharSet(FontCharset.DEFAULT); - assertEquals(FontCharset.DEFAULT.getNativeId(),ctFont.getCharsetArray(0).getVal()); + xssfFont.setCharSet(DEFAULT); + assertEquals(DEFAULT.getNativeId(),ctFont.getCharsetArray(0).getVal()); // Try with a few less usual ones: // Set with the Charset itself - xssfFont.setCharSet(FontCharset.RUSSIAN); - assertEquals(FontCharset.RUSSIAN.getNativeId(), xssfFont.getCharSet()); + xssfFont.setCharSet(RUSSIAN); + assertEquals(RUSSIAN.getNativeId(), xssfFont.getCharSet()); // And set with the Charset index - xssfFont.setCharSet(FontCharset.ARABIC.getNativeId()); - assertEquals(FontCharset.ARABIC.getNativeId(), xssfFont.getCharSet()); - xssfFont.setCharSet((byte)(FontCharset.ARABIC.getNativeId())); - assertEquals(FontCharset.ARABIC.getNativeId(), xssfFont.getCharSet()); + xssfFont.setCharSet(ARABIC.getNativeId()); + assertEquals(ARABIC.getNativeId(), xssfFont.getCharSet()); + xssfFont.setCharSet((byte)(ARABIC.getNativeId())); + assertEquals(ARABIC.getNativeId(), xssfFont.getCharSet()); // This one isn't allowed assertNull(FontCharset.valueOf(9999)); diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java index ee2ae86aac..6a16227335 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java @@ -1420,8 +1420,8 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { ) { CTExternalLink link = workbook2.getExternalLinksTable(0).getCTExternalLink(); CTExternalSheetData sheetData = link.getExternalBook().getSheetDataSet().getSheetDataArray(0); - assertEquals(Double.valueOf(sheetData.getRowArray(0).getCellArray(0).getV()), v1); - assertEquals(Double.valueOf(sheetData.getRowArray(0).getCellArray(1).getV()), v2); + assertEquals(v1, Double.valueOf(sheetData.getRowArray(0).getCellArray(0).getV())); + assertEquals(v2, Double.valueOf(sheetData.getRowArray(0).getCellArray(1).getV())); } } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentAtom.java index 06cd97984f..e24d932d4d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentAtom.java @@ -110,16 +110,6 @@ public final class DocumentAtom extends RecordAtom { */ public SlideSize getSlideSizeType() { return SlideSize.values()[slideSizeType]; } - /** - * The Size of the Document's slides, {@link DocumentAtom.SlideSize} for values. - * @deprecated replaced by {@link #getSlideSizeType()} - */ - @Deprecated - @Removal(version = "6.0.0") - public SlideSize getSlideSizeTypeEnum() { - return SlideSize.values()[slideSizeType]; - } - public void setSlideSize(SlideSize size) { slideSizeType = size.ordinal(); } @@ -247,7 +237,7 @@ public final class DocumentAtom extends RecordAtom { m.put("notesMasterPersist", this::getNotesMasterPersist); m.put("handoutMasterPersist", this::getHandoutMasterPersist); m.put("firstSlideNum", this::getFirstSlideNum); - m.put("slideSize", this::getSlideSizeTypeEnum); + m.put("slideSize", this::getSlideSizeType); m.put("saveWithFonts", this::getSaveWithFonts); m.put("omitTitlePlace", this::getOmitTitlePlace); m.put("rightToLeft", this::getRightToLeft); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java index b844a29ca4..53cea30d10 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java @@ -488,26 +488,6 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe return getFollowMasterObjects(); } - @Override - public boolean getDisplayPlaceholder(final Placeholder placeholder) { - final HeadersFooters hf = getHeadersFooters(); - final SlideLayoutType slt = getSlideRecord().getSlideAtom().getSSlideLayoutAtom().getGeometryType(); - final boolean isTitle = - (slt == SlideLayoutType.TITLE_SLIDE || slt == SlideLayoutType.TITLE_ONLY || slt == SlideLayoutType.MASTER_TITLE); - switch (placeholder) { - case DATETIME: - return (hf.isDateTimeVisible() && (hf.isTodayDateVisible() || (hf.isUserDateVisible() && hf.getUserDateAtom() != null))) && !isTitle; - case SLIDE_NUMBER: - return hf.isSlideNumberVisible() && !isTitle; - case HEADER: - return hf.isHeaderVisible() && hf.getHeaderAtom() != null && !isTitle; - case FOOTER: - return hf.isFooterVisible() && hf.getFooterAtom() != null && !isTitle; - default: - return false; - } - } - @Override public boolean getDisplayPlaceholder(final SimpleShape<?,?> placeholderRef) { Placeholder placeholder = placeholderRef.getPlaceholder(); diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java index 080d907e6c..d9e7eb33cd 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java @@ -220,20 +220,6 @@ public final class HSSFCellStyle implements CellStyle, Duplicatable { return _format.getFontIndex(); } - /** - * gets the index of the font for this style - * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(int) - * @deprecated use {@link #getFontIndex()} instead - * @since 4.0.0 - */ - @Deprecated - @Removal(version = "6.0.0") - @Override - public int getFontIndexAsInt() - { - return _format.getFontIndex(); - } - /** * gets the font for this style * @param parentWorkbook The HSSFWorkbook that this style belongs to diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFFont.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFFont.java index 38998c6043..2710eef12f 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFFont.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFFont.java @@ -86,14 +86,6 @@ public final class HSSFFont implements Font { @Override public int getIndex() { return index; } - @Deprecated - @Removal(version = "6.0.0") - @Override - public int getIndexAsInt() - { - return index; - } - /** * set the font height in unit's of 1/20th of a point. Maybe you might want to * use the setFontHeightInPoints which matches to the familiar 10, 12, 14 etc.. diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index 6c7bb93a2b..0795b91c93 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -1251,13 +1251,6 @@ public final class HSSFWorkbook extends POIDocument implements Workbook { return workbook.getNumberOfFontRecords(); } - @Override - @Deprecated - @Removal(version="6.0.0") - public int getNumberOfFontsAsInt() { - return getNumberOfFonts(); - } - @Override public HSSFFont getFontAt(int idx) { if (fonts == null) { diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java b/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java index bfd650cdf0..5224336722 100644 --- a/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java +++ b/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java @@ -48,25 +48,6 @@ public interface Slide< */ String getTitle(); - /** - * In XSLF, slidenumber and date shapes aren't marked as placeholders - * whereas in HSLF they are activated via a HeadersFooter configuration. - * This method is used to generalize that handling. - * - * @param placeholder the placeholder type - * @return {@code true} if the placeholder should be displayed/rendered - * @since POI 3.16-beta2 - * - * @deprecated in POI 5.2.0 - use {@link #getDisplayPlaceholder(SimpleShape)} - * - */ - @Deprecated - @Removal(version = "6.0.0") - default boolean getDisplayPlaceholder(Placeholder placeholder) { - return false; - } - - /** * In XSLF, slidenumber and date shapes aren't marked as placeholders * whereas in HSLF they are activated via a HeadersFooter configuration. diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/DateParser.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/DateParser.java deleted file mode 100644 index a8419bc51f..0000000000 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/DateParser.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.ss.formula.atp; - -import org.apache.poi.util.Removal; - -/** - * Parser for java dates. - * @deprecated in 5.0.0 - use {@link org.apache.poi.ss.util.DateParser} - */ -@Removal(version = "6.0.0") -@Deprecated -public class DateParser extends org.apache.poi.ss.util.DateParser { -} diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed0ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed0ArgFunction.java deleted file mode 100644 index 60aed9928b..0000000000 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed0ArgFunction.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.ss.formula.functions; - -import org.apache.poi.ss.formula.eval.ErrorEval; -import org.apache.poi.ss.formula.eval.ValueEval; -import org.apache.poi.util.Removal; - -/** - * Convenience base class for functions that only take zero arguments. - * - * @deprecated replaced by lambda expressions in 5.1.0 - */ -@Deprecated -@Removal(version = "6.0.0") -public abstract class Fixed0ArgFunction implements Function0Arg { - public final ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { - if (args.length != 0) { - return ErrorEval.VALUE_INVALID; - } - return evaluate(srcRowIndex, srcColumnIndex); - } -} diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function0Arg.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function0Arg.java deleted file mode 100644 index e8e46167e7..0000000000 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function0Arg.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.ss.formula.functions; - -import org.apache.poi.ss.formula.eval.ValueEval; -import org.apache.poi.util.Removal; - -/** - * Implemented by all functions that can be called with zero arguments - * - * @deprecated replaced by lambda expressions in 5.0.1 - */ -@Deprecated -@Removal(version = "6.0.0") -public interface Function0Arg extends Function { - /** - * see {@link Function#evaluate(ValueEval[], int, int)} - */ - ValueEval evaluate(int srcRowIndex, int srcColumnIndex); -} diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/CellStyle.java b/poi/src/main/java/org/apache/poi/ss/usermodel/CellStyle.java index 224c3845fc..e02b5ba383 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/CellStyle.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/CellStyle.java @@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel; import java.util.EnumMap; -import org.apache.poi.util.Removal; - public interface CellStyle { /** @@ -62,16 +60,6 @@ public interface CellStyle { */ int getFontIndex(); - /** - * gets the index of the font for this style - * @see Workbook#getFontAt(int) - * @deprecated use {@link #getFontIndex()} instead - * @since 4.0.0 - */ - @Deprecated - @Removal(version = "6.0.0") - int getFontIndexAsInt(); - /** * set the cell's using this style to be hidden * @param hidden - whether the cell using this style should be hidden @@ -95,7 +83,7 @@ public interface CellStyle { * @return hidden - whether the cell using this style should be locked */ boolean getLocked(); - + /** * Turn on or off "Quote Prefix" or "123 Prefix" for the style, * which is used to tell Excel that the thing which looks like @@ -104,7 +92,7 @@ public interface CellStyle { * like prefixing the cell value with a ' in Excel */ void setQuotePrefixed(boolean quotePrefix); - + /** * Is "Quote Prefix" or "123 Prefix" enabled for the cell? * Having this on is somewhat (but not completely, see {@link IgnoredErrorType}) @@ -154,8 +142,8 @@ public interface CellStyle { /** * set the degree of rotation for the text in the cell. * - * Note: HSSF uses values from -90 to 90 degrees, whereas XSSF - * uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges + * Note: HSSF uses values from -90 to 90 degrees, whereas XSSF + * uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges * accordingly, however the corresponding getter is returning values in the range mandated by the current type * of Excel file-format that this CellStyle is applied to. * @@ -166,8 +154,8 @@ public interface CellStyle { /** * get the degree of rotation for the text in the cell. * - * Note: HSSF uses values from -90 to 90 degrees, whereas XSSF - * uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges + * Note: HSSF uses values from -90 to 90 degrees, whereas XSSF + * uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges * value-range as used by the type of Excel file-format that this CellStyle is applied to. * * @return rotation degrees (see note above) @@ -328,13 +316,13 @@ public interface CellStyle { * @return fill color index, or 0 if not indexed (XSSF only) */ short getFillBackgroundColor(); - + /** * Gets the color object representing the current * background fill, resolving indexes using * the supplied workbook. * This will work for both indexed and rgb - * defined colors. + * defined colors. */ Color getFillBackgroundColorColor(); @@ -355,29 +343,29 @@ public interface CellStyle { void setFillForegroundColor(Color color); /** - * get the foreground fill color, if the fill + * get the foreground fill color, if the fill * is defined with an indexed color. * @return fill color, or 0 if not indexed (XSSF only) */ short getFillForegroundColor(); - + /** * Gets the color object representing the current * foreground fill, resolving indexes using * the supplied workbook. * This will work for both indexed and rgb - * defined colors. + * defined colors. */ Color getFillForegroundColorColor(); /** * Clones all the style information from another - * CellStyle, onto this one. This + * CellStyle, onto this one. This * CellStyle will then have all the same * properties as the source, but the two may * be edited independently. - * Any stylings on this CellStyle will be lost! - * + * Any stylings on this CellStyle will be lost! + * * The source CellStyle could be from another * Workbook if you like. This allows you to * copy styles from one Workbook to another. @@ -387,7 +375,7 @@ public interface CellStyle { * XSSFCellStyle) */ void cloneStyleFrom(CellStyle source); - + /** * Controls if the Cell should be auto-sized * to shrink to fit if the text is too long @@ -420,7 +408,7 @@ public interface CellStyle { * should call this method whenever a property is changed. * The API is public just in case users find that the CellStyle implementations * are not calling this method when they should. - * + * * @since POI 5.5.0 */ void invalidateCachedProperties(); diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/Font.java b/poi/src/main/java/org/apache/poi/ss/usermodel/Font.java index 60b8a91dc2..0e464aef53 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/Font.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/Font.java @@ -17,9 +17,6 @@ package org.apache.poi.ss.usermodel; - -import org.apache.poi.util.Removal; - public interface Font { // TODO: refactor and unify Font & FontFormatting in POI 5.0.0 // TODO: refactor the constants to enums in POI 5.0.0 @@ -271,18 +268,6 @@ public interface Font { */ int getIndex(); - /** - * get the index within the XSSFWorkbook (sequence within the collection of Font objects) - * - * @deprecated use {@link #getIndex()} instead - * @return unique index number of the underlying record this Font represents (probably you don't care - * unless you're comparing which one is which) - * @since 4.0.0 - */ - @Deprecated - @Removal(version = "6.0.0") - int getIndexAsInt(); - void setBold(boolean bold); boolean getBold(); diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/FontCharset.java b/poi/src/main/java/org/apache/poi/ss/usermodel/FontCharset.java deleted file mode 100644 index 24cb65f4e5..0000000000 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/FontCharset.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.ss.usermodel; - -import org.apache.poi.util.Removal; - -/** - * Charset represents the basic set of characters associated with a font (that it can display), and - * corresponds to the ANSI codepage (8-bit or DBCS) of that character set used by a given language. - * - * @deprecated enum will be replaced by common version org.apache.poi.common.usermodel.FontCharset - */ -@Removal(version="6.0.0") -@Deprecated -public enum FontCharset { - - ANSI(0), - DEFAULT(1), - SYMBOL(2), - MAC(77), - SHIFTJIS(128), - HANGEUL(129), - JOHAB(130), - GB2312(134), - CHINESEBIG5(136), - GREEK(161), - TURKISH(162), - VIETNAMESE(163), - HEBREW(177), - ARABIC(178), - BALTIC(186), - RUSSIAN(204), - THAI(222), - EASTEUROPE(238), - OEM(255); - - - private int charset; - - private FontCharset(int value){ - charset = value; - } - - /** - * Returns value of this charset - * - * @return value of this charset - */ - public int getValue(){ - return charset; - } - - private static FontCharset[] _table = new FontCharset[256]; - static { - for (FontCharset c : values()) { - _table[c.getValue()] = c; - } - } - - public static FontCharset valueOf(int value){ - if(value >= _table.length) - return null; - return _table[value]; - } -} diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/Workbook.java b/poi/src/main/java/org/apache/poi/ss/usermodel/Workbook.java index 64d6c1cf41..790ae99f7b 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/Workbook.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/Workbook.java @@ -29,7 +29,6 @@ import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.formula.EvaluationWorkbook; import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; -import org.apache.poi.util.Removal; /** * High level representation of a Excel workbook. This is the first object most users @@ -296,16 +295,6 @@ public interface Workbook extends Closeable, Iterable<Sheet> { */ int getNumberOfFonts(); - /** - * Get the number of fonts in the font table - * - * @return number of fonts - * @since 4.0.0 - */ - @Deprecated - @Removal(version = "6.0.0") - int getNumberOfFontsAsInt(); - /** * Get the font at the given index number * diff --git a/poi/src/main/java/org/apache/poi/util/StaxHelper.java b/poi/src/main/java/org/apache/poi/util/StaxHelper.java deleted file mode 100644 index 9563666532..0000000000 --- a/poi/src/main/java/org/apache/poi/util/StaxHelper.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.util; - -import javax.xml.stream.XMLEventFactory; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - - -/** - * Provides handy methods for working with StAX parsers and readers - * - * @deprecated use {@link XMLHelper} - */ -@Deprecated -@Removal(version = "6.0.0") -public final class StaxHelper { - private StaxHelper() { - } - - /** - * Creates a new StAX XMLInputFactory, with sensible defaults - */ - public static XMLInputFactory newXMLInputFactory() { - return XMLHelper.newXMLInputFactory(); - } - - /** - * Creates a new StAX XMLOutputFactory, with sensible defaults - */ - public static XMLOutputFactory newXMLOutputFactory() { - return XMLHelper.newXMLOutputFactory(); - } - - /** - * Creates a new StAX XMLEventFactory, with sensible defaults - */ - public static XMLEventFactory newXMLEventFactory() { - return XMLHelper.newXMLEventFactory(); - } -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
