poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fannin...@apache.org
Subject svn commit: r1844311 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
Date Fri, 19 Oct 2018 07:43:04 GMT
Author: fanningpj
Date: Fri Oct 19 07:43:04 2018
New Revision: 1844311

URL: http://svn.apache.org/viewvc?rev=1844311&view=rev
Log:
fix class cast issur recently introduced in BaseXSSFFormulaEvaluator

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java?rev=1844311&r1=1844310&r2=1844311&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java Fri
Oct 19 07:43:04 2018
@@ -73,9 +73,14 @@ public abstract class BaseXSSFFormulaEva
     }
     
     protected void setCellType(Cell cell, CellType cellType) {
-        EvaluationWorkbook evaluationWorkbook = getEvaluationWorkbook();
-        BaseXSSFEvaluationWorkbook xewb = BaseXSSFEvaluationWorkbook.class.isAssignableFrom(evaluationWorkbook.getClass())
? (BaseXSSFEvaluationWorkbook) evaluationWorkbook : null;
-        
-        ((XSSFCell) cell).setCellType(cellType, xewb);
+        if (cell instanceof  XSSFCell) {
+            EvaluationWorkbook evaluationWorkbook = getEvaluationWorkbook();
+            BaseXSSFEvaluationWorkbook xewb = BaseXSSFEvaluationWorkbook.class.isAssignableFrom(evaluationWorkbook.getClass())
? (BaseXSSFEvaluationWorkbook) evaluationWorkbook : null;
+
+            ((XSSFCell) cell).setCellType(cellType, xewb);
+        } else {
+            // could be an SXSSFCell
+            cell.setCellType(cellType);
+        }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message