aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2007-11-06 18:52:52 +0000
committerYegor Kozlov <yegor@apache.org>2007-11-06 18:52:52 +0000
commite072572961517da59994019d54b263417aaf7bc9 (patch)
tree32ea02770a9cc34793e7cb6823a17139391ab225 /src/java/org
parent76b3f602c105b990b5106a7f6a0d24509da692a1 (diff)
downloadpoi-e072572961517da59994019d54b263417aaf7bc9.tar.gz
poi-e072572961517da59994019d54b263417aaf7bc9.zip
throw exception when the maximum number of fonts was exceeded
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@592520 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
index d56303d42a..487f9c6b22 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
@@ -802,6 +802,9 @@ public class HSSFWorkbook extends POIDocument
{
fontindex++; // THERE IS NO FOUR!!
}
+ if(fontindex == Short.MAX_VALUE){
+ throw new IllegalArgumentException("Maximum number of fonts was exceeded");
+ }
HSSFFont retval = new HSSFFont(fontindex, font);
return retval;