poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1693767 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
Date Sat, 01 Aug 2015 21:34:34 GMT
Author: nick
Date: Sat Aug  1 21:34:34 2015
New Revision: 1693767

URL: http://svn.apache.org/r1693767
Log:
Use the same "is this a formula" logic for both getCellType and getCachedFormulaResultType

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

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=1693767&r1=1693766&r2=1693767&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java Sat Aug  1 21:34:34
2015
@@ -536,6 +536,13 @@ public final class XSSFCell implements C
             _cell.setS(idx);
         }
     }
+    
+    private boolean isFormulaCell() {
+        if (_cell.getF() != null || getSheet().isCellInArrayFormulaContext(this)) {
+            return true;
+        }
+        return false;
+    }
 
     /**
      * Return the cell type.
@@ -550,10 +557,7 @@ public final class XSSFCell implements C
      */
     @Override
     public int getCellType() {
-
-        if (_cell.getF() != null || getSheet().isCellInArrayFormulaContext(this)) {
-            return CELL_TYPE_FORMULA;
-        }
+        if (isFormulaCell()) return CELL_TYPE_FORMULA;
 
         return getBaseCellType(true);
     }
@@ -566,7 +570,7 @@ public final class XSSFCell implements C
      */
     @Override
     public int getCachedFormulaResultType() {
-        if (_cell.getF() == null) {
+        if (! isFormulaCell()) {
             throw new IllegalStateException("Only formula cells have cached results");
         }
 



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


Mime
View raw message