aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/ss/util
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2011-10-05 21:18:25 +0000
committerNick Burch <nick@apache.org>2011-10-05 21:18:25 +0000
commita45b2cd33f452068b542cf423812f7377d000e82 (patch)
tree559fc97c842305b9a48d4341dce1e126826b625f /src/java/org/apache/poi/ss/util
parent9395942e91d1e4998fa7d94c710275d423306942 (diff)
downloadpoi-a45b2cd33f452068b542cf423812f7377d000e82.tar.gz
poi-a45b2cd33f452068b542cf423812f7377d000e82.zip
Fix bug #51963 - Correct AreaReference handling of references containing a sheet name which includes a comma
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1179444 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/ss/util')
-rw-r--r--src/java/org/apache/poi/ss/util/AreaReference.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/java/org/apache/poi/ss/util/AreaReference.java b/src/java/org/apache/poi/ss/util/AreaReference.java
index ffa0c8888d..2082634d18 100644
--- a/src/java/org/apache/poi/ss/util/AreaReference.java
+++ b/src/java/org/apache/poi/ss/util/AreaReference.java
@@ -152,13 +152,20 @@ public class AreaReference {
* unbroken) area, or is it made up of
* several different parts?
* (If it is, you will need to call
- * ....
+ * {@link #generateContiguous(String)})
*/
public static boolean isContiguous(String reference) {
- if(reference.indexOf(',') == -1) {
- return true;
- }
- return false;
+ // If there's a sheet name, strip it off
+ int sheetRefEnd = reference.indexOf('!');
+ if(sheetRefEnd != -1) {
+ reference = reference.substring(sheetRefEnd);
+ }
+
+ // Check for the , as a sign of non-coniguous
+ if(reference.indexOf(',') == -1) {
+ return true;
+ }
+ return false;
}
public static AreaReference getWholeRow(String start, String end) {