diff options
author | Javen O'Neal <onealj@apache.org> | 2016-06-18 01:21:08 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2016-06-18 01:21:08 +0000 |
commit | f982913bb186a2dbc171a0691ed3467ad26c9146 (patch) | |
tree | 372fc7d5c68f688026cb6baedf35307f586861ad /src/ooxml/java/org/apache | |
parent | 172ac0be6055dfee6b0025418df22e52919e3da0 (diff) | |
download | poi-f982913bb186a2dbc171a0691ed3467ad26c9146.tar.gz poi-f982913bb186a2dbc171a0691ed3467ad26c9146.zip |
bug 59718: deprecate get/setBoldweight. Use get/setBold
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748898 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache')
3 files changed, 42 insertions, 0 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java b/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java index d0e73adb0d..209dc722a1 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java @@ -803,6 +803,7 @@ public class StylesTable extends POIXMLDocumentPart { /** * Finds a font that matches the one with the supplied attributes + * @deprecated POI 3.15 beta 2. Use {@link #findFont(boolean, short, short, String, boolean, boolean, short, byte)} instead. */ public XSSFFont findFont(short boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { for (XSSFFont font : fonts) { @@ -820,4 +821,24 @@ public class StylesTable extends POIXMLDocumentPart { } return null; } + + /** + * Finds a font that matches the one with the supplied attributes + */ + public XSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { + for (XSSFFont font : fonts) { + if ( (font.getBold() == bold) + && font.getColor() == color + && font.getFontHeight() == fontHeight + && font.getFontName().equals(name) + && font.getItalic() == italic + && font.getStrikeout() == strikeout + && font.getTypeOffset() == typeOffset + && font.getUnderline() == underline) + { + return font; + } + } + return null; + } } diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java index d741782a97..668e473ac5 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFWorkbook.java @@ -813,12 +813,24 @@ public class SXSSFWorkbook implements Workbook { * Finds a font that matches the one with the supplied attributes * * @return the font with the matched attributes or <code>null</code> + * @deprecated POI 3.15 beta 2. Use {@link #findFont(boolean, short, short, String, boolean, boolean, short, byte)} instead. */ @Override public Font findFont(short boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { return _wb.findFont(boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline); } + + /** + * Finds a font that matches the one with the supplied attributes + * + * @return the font with the matched attributes or <code>null</code> + */ + @Override + public Font findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) + { + return _wb.findFont(bold, color, fontHeight, name, italic, strikeout, typeOffset, underline); + } /** diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index 84b131889b..ce4b033fc1 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -870,11 +870,20 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook { /** * Finds a font that matches the one with the supplied attributes + * @deprecated POI 3.15. Use {@link #findFont(boolean, short, short, String, boolean, boolean, short, byte)} instead. */ @Override public XSSFFont findFont(short boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { return stylesSource.findFont(boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline); } + + /** + * Finds a font that matches the one with the supplied attributes + */ + @Override + public XSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { + return stylesSource.findFont(bold, color, fontHeight, name, italic, strikeout, typeOffset, underline); + } /** * Convenience method to get the active sheet. The active sheet is is the sheet |