aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-12-09 18:20:00 +0000
committerPJ Fanning <fanningpj@apache.org>2020-12-09 18:20:00 +0000
commitea59cc2bc90b4ab8401217f469cde4d4ab63d789 (patch)
treefece5cb03d799cb228802c3b9a3e2421774f76bb
parent5aef414f2a6f7ec181f01255e5b56593a3c24723 (diff)
downloadpoi-ea59cc2bc90b4ab8401217f469cde4d4ab63d789.tar.gz
poi-ea59cc2bc90b4ab8401217f469cde4d4ab63d789.zip
reduce use of deprecated code in XSSFFont
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884266 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/poi/ss/usermodel/FontCharset.java2
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/java/org/apache/poi/ss/usermodel/FontCharset.java b/src/java/org/apache/poi/ss/usermodel/FontCharset.java
index 64953675f7..24cb65f4e5 100644
--- a/src/java/org/apache/poi/ss/usermodel/FontCharset.java
+++ b/src/java/org/apache/poi/ss/usermodel/FontCharset.java
@@ -25,7 +25,7 @@ import org.apache.poi.util.Removal;
*
* @deprecated enum will be replaced by common version org.apache.poi.common.usermodel.FontCharset
*/
-@Removal(version="4.0")
+@Removal(version="6.0.0")
@Deprecated
public enum FontCharset {
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
index ddd278eb8e..7b26dcb565 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
@@ -127,8 +127,7 @@ public class XSSFFont implements Font {
*/
public int getCharSet() {
CTIntProperty charset = _ctFont.sizeOfCharsetArray() == 0 ? null : _ctFont.getCharsetArray(0);
- return charset == null ? org.apache.poi.ss.usermodel.FontCharset.ANSI.getValue() :
- org.apache.poi.ss.usermodel.FontCharset.valueOf(charset.getVal()).getValue();
+ return charset == null ? FontCharset.ANSI.getNativeId() : FontCharset.valueOf(charset.getVal()).getNativeId();
}
@@ -313,7 +312,7 @@ public class XSSFFont implements Font {
* set character-set to use.
*
* @param charset - charset
- * @see org.apache.poi.ss.usermodel.FontCharset
+ * @see FontCharset
*/
public void setCharSet(byte charset) {
int cs = charset & 0xff;
@@ -324,14 +323,14 @@ public class XSSFFont implements Font {
* set character-set to use.
*
* @param charset - charset
- * @see org.apache.poi.ss.usermodel.FontCharset
+ * @see FontCharset
*/
public void setCharSet(int charset) {
- org.apache.poi.ss.usermodel.FontCharset fontCharset = org.apache.poi.ss.usermodel.FontCharset.valueOf(charset);
+ FontCharset fontCharset = FontCharset.valueOf(charset);
if(fontCharset != null) {
setCharSet(fontCharset);
} else {
- throw new POIXMLException("Attention: an attempt to set a type of unknow charset and charset");
+ throw new POIXMLException("Attention: an attempt to set a type of unknown charset and charset");
}
}
@@ -339,7 +338,10 @@ public class XSSFFont implements Font {
* set character-set to use.
*
* @param charSet
+ * @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) {