Bug28755: CellReference will throws IllegalArgumentException when an illegal cell reference is provided.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437522 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Height 2006-08-28 03:54:04 +00:00
parent bde0ed706b
commit 602869877e
1 changed files with 5 additions and 1 deletions

View File

@ -34,13 +34,17 @@ public class CellReference {
public CellReference(String cellRef) {
String[] parts = separateRefParts(cellRef);
sheetName = parts[0];
String ref = parts[1];
String ref = parts[1];
if ((ref == null)||("".equals(ref)))
throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
if (ref.charAt(0) == '$') {
colAbs=true;
ref=ref.substring(1);
}
col = convertColStringToNum(ref);
ref=parts[2];
if ((ref == null)||("".equals(ref)))
throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
if (ref.charAt(0) == '$') {
rowAbs=true;
ref=ref.substring(1);