You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2020/12/09 18:20:00 UTC
svn commit: r1884266 - in /poi/trunk/src:
java/org/apache/poi/ss/usermodel/FontCharset.java
ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
Author: fanningpj
Date: Wed Dec 9 18:20:00 2020
New Revision: 1884266
URL: http://svn.apache.org/viewvc?rev=1884266&view=rev
Log:
reduce use of deprecated code in XSSFFont
Modified:
poi/trunk/src/java/org/apache/poi/ss/usermodel/FontCharset.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/FontCharset.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/FontCharset.java?rev=1884266&r1=1884265&r2=1884266&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/FontCharset.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/FontCharset.java Wed Dec 9 18:20:00 2020
@@ -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 {
Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java?rev=1884266&r1=1884265&r2=1884266&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java Wed Dec 9 18:20:00 2020
@@ -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) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org