diff --git a/src/java/org/apache/poi/ss/SpreadsheetVersion.java b/src/java/org/apache/poi/ss/SpreadsheetVersion.java
index 8030e0228..154e50167 100644
--- a/src/java/org/apache/poi/ss/SpreadsheetVersion.java
+++ b/src/java/org/apache/poi/ss/SpreadsheetVersion.java
@@ -36,10 +36,11 @@ public enum SpreadsheetVersion {
*
The total number of available rows is 64k (2^16)
* The maximum number of arguments to a function is 30
* Number of conditional format conditions on a cell is 3
+ * Number of cell styles is 4000
* Length of text cell contents is 32767
*
*/
- EXCEL97(0x10000, 0x0100, 30, 3, 32767),
+ EXCEL97(0x10000, 0x0100, 30, 3, 4000, 32767),
/**
* Excel2007
@@ -50,22 +51,25 @@ public enum SpreadsheetVersion {
* The maximum number of arguments to a function is 255
* Number of conditional format conditions on a cell is unlimited
* (actually limited by available memory in Excel)
+ * Number of cell styles is 64000
* Length of text cell contents is 32767
*
*/
- EXCEL2007(0x100000, 0x4000, 255, Integer.MAX_VALUE, 32767);
+ EXCEL2007(0x100000, 0x4000, 255, Integer.MAX_VALUE, 64000, 32767);
private final int _maxRows;
private final int _maxColumns;
private final int _maxFunctionArgs;
private final int _maxCondFormats;
+ private final int _maxCellStyles;
private final int _maxTextLength;
- private SpreadsheetVersion(int maxRows, int maxColumns, int maxFunctionArgs, int maxCondFormats, int maxText) {
+ private SpreadsheetVersion(int maxRows, int maxColumns, int maxFunctionArgs, int maxCondFormats, int maxCellStyles, int maxText) {
_maxRows = maxRows;
_maxColumns = maxColumns;
_maxFunctionArgs = maxFunctionArgs;
_maxCondFormats = maxCondFormats;
+ _maxCellStyles = maxCellStyles;
_maxTextLength = maxText;
}
@@ -105,13 +109,19 @@ public enum SpreadsheetVersion {
}
/**
- *
* @return the maximum number of conditional format conditions on a cell
*/
public int getMaxConditionalFormats() {
return _maxCondFormats;
}
+ /**
+ * @return the maximum number of cell styles per spreadsheet
+ */
+ public int getMaxCellStyles() {
+ return _maxCellStyles;
+ }
+
/**
*
* @return the last valid column index in a ALPHA-26 representation
@@ -127,5 +137,4 @@ public enum SpreadsheetVersion {
public int getMaxTextLength() {
return _maxTextLength;
}
-
}