aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/ss/util
diff options
context:
space:
mode:
authorJosh Micich <josh@apache.org>2009-04-06 08:22:25 +0000
committerJosh Micich <josh@apache.org>2009-04-06 08:22:25 +0000
commit5e0d5e9510084a7a73ffe73010e6b524d0dbb02e (patch)
treeb021a4109f026ed8371431b57f574db9879ee367 /src/java/org/apache/poi/ss/util
parent5226bccd066eb3988c73be6b820873257711df58 (diff)
downloadpoi-5e0d5e9510084a7a73ffe73010e6b524d0dbb02e.tar.gz
poi-5e0d5e9510084a7a73ffe73010e6b524d0dbb02e.zip
Bug 46951 - fixed formula parser to better handle range operators and whole row/column refs.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@762250 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.java10
-rw-r--r--src/java/org/apache/poi/ss/util/CellReference.java2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/ss/util/AreaReference.java b/src/java/org/apache/poi/ss/util/AreaReference.java
index 30d92ebcf4..c3b383edf6 100644
--- a/src/java/org/apache/poi/ss/util/AreaReference.java
+++ b/src/java/org/apache/poi/ss/util/AreaReference.java
@@ -158,7 +158,15 @@ public class AreaReference {
}
return false;
}
-
+
+ public static AreaReference getWholeRow(String start, String end) {
+ return new AreaReference("$A" + start + ":$IV" + end);
+ }
+
+ public static AreaReference getWholeColumn(String start, String end) {
+ return new AreaReference(start + "$1:" + end + "$65536");
+ }
+
/**
* Is the reference for a whole-column reference,
* such as C:C or D:G ?
diff --git a/src/java/org/apache/poi/ss/util/CellReference.java b/src/java/org/apache/poi/ss/util/CellReference.java
index e56bbe86f9..63d80f1c58 100644
--- a/src/java/org/apache/poi/ss/util/CellReference.java
+++ b/src/java/org/apache/poi/ss/util/CellReference.java
@@ -291,7 +291,7 @@ public class CellReference {
return true;
}
- private static boolean isColumnWithnRange(String colStr) {
+ public static boolean isColumnWithnRange(String colStr) {
int numberOfLetters = colStr.length();
if(numberOfLetters > BIFF8_LAST_COLUMN_TEXT_LEN) {
// "Sheet1" case etc