diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java index 884949d6d7..140ca8bfc2 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDefaultRunStyle.java @@ -17,6 +17,7 @@ package org.apache.poi.xwpf.usermodel; +import org.apache.poi.util.Removal; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr; import java.math.BigDecimal; @@ -37,11 +38,26 @@ 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. + * + * @return value representing the font size (can be null if size is not set) + * @since POI 5.0.0 + */ public Double getFontSizeAsDouble() { BigDecimal bd = getFontSizeAsBigDecimal(1); return bd == null ? null : bd.doubleValue(); diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java index 0dece4dab6..96821bde3b 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java @@ -867,7 +867,8 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { * Specifies the font size which shall be applied to all non complex script * characters in the contents of this run when displayed. * - * @return value representing the font size (non-integer size will be rounded with half rounding up) + * @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 @@ -882,7 +883,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { * Specifies the font size which shall be applied to all non complex script * characters in the contents of this run when displayed. * - * @return value representing the font size + * @return value representing the font size (can be null if size not set) * @since POI 5.0.0 */ @Override