aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xssf/model
diff options
context:
space:
mode:
authorJaven O'Neal <onealj@apache.org>2016-06-18 01:21:08 +0000
committerJaven O'Neal <onealj@apache.org>2016-06-18 01:21:08 +0000
commitf982913bb186a2dbc171a0691ed3467ad26c9146 (patch)
tree372fc7d5c68f688026cb6baedf35307f586861ad /src/ooxml/java/org/apache/poi/xssf/model
parent172ac0be6055dfee6b0025418df22e52919e3da0 (diff)
downloadpoi-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/poi/xssf/model')
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java21
1 files changed, 21 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;
+ }
}