aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/hssf/model
diff options
context:
space:
mode:
authorJason Height <jheight@apache.org>2006-08-28 12:18:10 +0000
committerJason Height <jheight@apache.org>2006-08-28 12:18:10 +0000
commit4859068eb4915c534d610cb3c13ddc0f91a1052d (patch)
treef0b578611948d5f9c2d05dfee641d37e27543788 /src/java/org/apache/poi/hssf/model
parenta2d9acef5602392d5a117355c44e7f97074c703d (diff)
downloadpoi-4859068eb4915c534d610cb3c13ddc0f91a1052d.tar.gz
poi-4859068eb4915c534d610cb3c13ddc0f91a1052d.zip
bug 31044: Corrected parsing of references which contain double sheet names ie 'Sheet 1'!F1:'Sheet 1'!F10.
Although i have hacked it a bit such that it gets translated to 'Sheet 1'!F1:F10 git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437684 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/hssf/model')
-rw-r--r--src/java/org/apache/poi/hssf/model/FormulaParser.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/hssf/model/FormulaParser.java b/src/java/org/apache/poi/hssf/model/FormulaParser.java
index 0be6488e68..816b044512 100644
--- a/src/java/org/apache/poi/hssf/model/FormulaParser.java
+++ b/src/java/org/apache/poi/hssf/model/FormulaParser.java
@@ -290,8 +290,19 @@ public class FormulaParser {
if (look == ':') {
Match(':');
String second=GetName();
-
- tokens.add(new Area3DPtg(first+":"+second,externIdx));
+ if (look == '!') {
+ //The sheet name was included in both of the areas. Only really
+ //need it once
+ Match('!');
+ String third=GetName();
+
+ if (!sheetName.equals(second))
+ throw new RuntimeException("Unhandled double sheet reference.");
+
+ tokens.add(new Area3DPtg(first+":"+third,externIdx));
+ } else {
+ tokens.add(new Area3DPtg(first+":"+second,externIdx));
+ }
} else {
tokens.add(new Ref3DPtg(first,externIdx));
}