]> source.dussan.org Git - poi.git/commitdiff
sonar issues
authorPJ Fanning <fanningpj@apache.org>
Tue, 1 Feb 2022 21:16:05 +0000 (21:16 +0000)
committerPJ Fanning <fanningpj@apache.org>
Tue, 1 Feb 2022 21:16:05 +0000 (21:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897675 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java

index 722d4334e4c8dddab5f8bdba0587ba3a01a9b393..8b3eef1bc4e4a6bfad57b2a42ffebe9e49d697bd 100644 (file)
@@ -114,8 +114,7 @@ public abstract class BaseXSSFFormulaEvaluator extends BaseFormulaEvaluator {
                                 XSSFCell cell = row.getCell(cellIndex);
                                 String cellValue = cell.getRawValue();
                                 String cellR = new CellReference(cell).formatAsString(false);
-                                externalLinksTable.cacheData(sheet.getSheetName(), rowIndex + 1, cellR, cellValue);
-
+                                externalLinksTable.cacheData(sheet.getSheetName(), (long)rowIndex + 1, cellR, cellValue);
                             }
                         }
 
index bf87de22f0fe63ef36f1820403c60270d84723c2..b53b970736e887cbd8b7c9d63f8221e5c7fbcbda 100644 (file)
@@ -76,7 +76,8 @@ public final class NumberValueFunction implements FreeRefFunction {
             return e.getErrorEval();
         }
 
-        if("".equals(text)) text = "0"; //If an empty string ("") is specified as the Text argument, the result is 0.
+        if("".equals(text) || text == null) text = "0"; //If an empty string ("") is specified as the Text argument, the result is 0.
+
         text = text.replace(" ", ""); //Empty spaces in the Text argument are ignored, even in the middle of the argument. For example, " 3 000 " is returned as 3000.
         String[] parts = text.split("["+decSep+"]");
         String sigPart = "";