You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by jh...@apache.org on 2006/08/28 14:18:11 UTC

svn commit: r437684 - /jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/FormulaParser.java

Author: jheight
Date: Mon Aug 28 05:18:10 2006
New Revision: 437684

URL: http://svn.apache.org/viewvc?rev=437684&view=rev
Log:
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

Modified:
    jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/FormulaParser.java

Modified: jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/FormulaParser.java
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/FormulaParser.java?rev=437684&r1=437683&r2=437684&view=diff
==============================================================================
--- jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/FormulaParser.java (original)
+++ jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/FormulaParser.java Mon Aug 28 05:18:10 2006
@@ -290,8 +290,19 @@
             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));
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/