aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/poi/hssf/usermodel/HSSFName.java')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFName.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFName.java b/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
index 4fde9e6cc3..6de2293794 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
@@ -126,8 +126,16 @@ public class HSSFName implements Name {
* @return true if the name refers to a deleted cell, false otherwise
*/
public boolean isDeleted(){
- String ref = getReference();
- return "#REF!".endsWith(ref);
+ String formulaText = getReference();
+ if (formulaText.startsWith("#REF!")) {
+ // sheet deleted
+ return true;
+ }
+ if (formulaText.endsWith("#REF!")) {
+ // cell range deleted
+ return true;
+ }
+ return false;
}
public boolean isFunctionName() {
return _definedNameRec.isFunctionName();