diff options
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java index c56cece348..3201544192 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/StylesTable.java @@ -467,10 +467,12 @@ public class StylesTable extends POIXMLDocumentPart implements Styles { public int putStyle(XSSFCellStyle style) { CTXf mainXF = style.getCoreXf(); - if(! xfs.contains(mainXF)) { + int ret = xfs.indexOf(mainXF); + if(ret == -1) { xfs.add(mainXF); + ret = xfs.size() - 1; } - return xfs.indexOf(mainXF); + return ret; } @Override |